Den 22. mai 2018 20:28, skrev Ian Zimmerman: > On 2018-05-22 12:00, Grant Taylor wrote: > >> You might also want to check out using vim or emacs as they have >> terminal emulators built in. They might be able to apply some command >> line history / editing (in a round about way). > Indeed, if there isn't a prepackaged way the next easiest is probably > customizing emacs "comint" mode (which is the base mode behind shell > mode and various other specialized interpreter modes). > Second that, use emacs. Basically you just need to teach emacs to recognize the prompt. Most likely it will already work.
There are at least three ways to use emacs for this. The best would be to run emacs on your local machine and then M-x serial-term or M-x shell. ('M' stands for meta, usually means you can push the 'alt' key together with a letter, but there are other ways if you have no alt key, like on a serial connection) . Third way would be to run emacs in text mode on the remote machine. If you have ssh running on the remote machine, check out the "tramp" package in emacs. With no gui, you would need to learn the old tty-commands in emacs, like push <esc> followed by 'x' instead of using ALT-x, but it should all be there. Pro-tip: if running emacs on the remote machine, make sure your terminal-connection does not interpret Control-S as a STOP signal, i.e. anything to do with XON/XOFF you do NOT want enabled in your shell-connection.