To edit, set FCEDIT to a text editor (ex, ed, emacs, vi, etc.) and use fc directly: fc -1. If you want to only print the command, use: fc -nl -1 -1. Or maybe the simpler fc -s -1, but zsh doesn't accept such option for fc.
#Tera term commands reference portable
Or the older and therefore usually more portable fc command (directly re-executes): fc -e -1 Like the quite verbose command (only to print): history 2 | head -n-1 There are some commands which are able to retrieve history commands. The history system provided by many shells allow the expansion of some shortcuts: !! # bash and zsh, may be provided by `alias \!\!='fc -e -'` in ksh. ĮSC- k # vi mode ESC to go to command mode and k for upĮSC- j # vi mode ESC to go to command mode and j for down history Other shells, like dash may not have an editing library to understand this keys (unless compiled with the -with-libedit option enabled). The line editor (where you type your commands) is provided directly by ksh, by the library readline in bash, and by the library zle in zsh. There are several layers in which you can ask for the last command. (Unfortunately, it does not seem to support named buffers.) So you can accomplish results comparable to !-2:- !$. For advanced users: you can even copy ( yank) text from one line.So, for example, Esc k i s u d o Space Enter is equivalent to sudo !!. To actually add to the command from history. So you will need to use a vi editing command Remember, you will still be in vi command mode, To re-execute the 12th previous command (same as !-12).Īnd then edit the bash command line you find there. run a VT100 terminal emulation program, such as Tera Term Pro (a free terminal. The minus key - also works as a "move up" command. auto-save-interval, Set the length of time to save the list of private. To re-execute the previous command (same as !!). (a tiny subset) Up Ctrl+PĪlternatively, you could set up your shell to use vi command editing mode, by adding set -o vi to your shell startup file (e.g., ~/.bashrc). Most shells that have a command line editing feature