Re: RUN the VI editor from a 4GL program
Posted in 1997
Jacob Salomon wrote: } } Hi Folks, } } I developing an application that involved allowing users to create/edit } a text blob using the vi editor. (I suspect the exact editor is not the } problem here, however.) I piece together the file name at run time and } "locate" the blob variable there with the following snippet of code: } } let curtime = current hour to second } let fname # Piece together a file name } = "/tmp/blob.", login_name clipped, "-", curtime clipped } } locate rp_libdoc_ldesc # Set up to edit/display in this file } in file fname } } I then piece together the vi command line: } } let edit_cmd = "vi ", fname } } So the command line looks something like: } libdoc.4gl:edit_lib_long.edit_cmd = "vi /tmp/blob.jake-17:14:57" } } Next, I RUN the command: (I am copy/pasting to a debugging session) } run edit_cmd } } This definitely gets me into vi. However, instead of looking like vi, } I see the escape sequences as strings on my screen. If I enter :f } command, I see the result buried in the garbage but I can't get it to } } behave like vi! } } Is it my emulator? Is this related to the debugger (or any 4GL } application) running in raw terminal mode already? If the latter, what } can I do to correct for this and get a normal vi session running? I } believe this will happen even if I use emacs; it's the terminal that's } screwed up! } } [3g[44;9HH[44;17HH[44;25HH[44;33HH[44;41HH[44;49HH[44;57HH[44;65HH[44;73HH[44;81HH[44;1H[?25h[?1h="/tmp/blob.jake-17:14:57" } } The above is what I see when vi is running. Yucch! } } Any ideas? Thanks. You've got a classic terminal emulation mismatch here. From vi, escape to shell and check the TERM environment variable: !echo $TERM or !sh echo $TERM exit It looks like vi is expecting vt100, but your terminal or telnet is set to something else. Keep in mind that ansi and vt100 ARE NOT THE SAME. Tim