You should utilize Emacs. Emacs is primarily an editor, but it surely additionally contains many associated options that allow you to profit from the Emacs’s capabilities when doing issues aside from enhancing recordsdata. Considered one of these options is Shell mode, the place you edit a command with Emacs then press ⏎ Enter to run it.
You possibly can obtain Emacs from Emacs For Mac OS X or from bundle managers equivalent to Homebrew, MacPorts or Fink.
Emacs has its personal enhancing instructions which are utterly completely different from Mac’s, however at the least the Emacs For Mac OS X comes with the usual Mac instructions predefined.
To start out Emacs and simply use it to run a shell:
emacs -e shell -e delete-other-windows
See the Guide for shell-related instructions equivalent to navigating historical past. You can even use F1 m to see an inventory of key bindings that apply particularly to Shell mode.
Shell mode provides you Emacs’s command line enhancing and infinite scrollback. It does have some downsides: full-screen terminal functions will not work, and also you solely get fundamental filename completion slightly than context-sensitive completion. Shell mode helps coloured output, however functions may not have the ability to detect it, for instance /bin/ls
would not (you may trick it with alias ls="TERM=xterm-256color ls -G"
).
Exiting the shell would not shut Emacs, as a result of utilizing Emacs solely to run a shell is uncommon. It will be doable to set it up in order that exiting the shell exits Emacs if it isn’t doing anything, however that might be materials for a separate query on Emacs SE.
Alternatively, you could want Time period to Shell. Time period is a full-blown terminal emulator. Which means Emacs transmits most key presses to the underlying shell. For instance, ⇥ Tab invokes the shell’s completion mechanism. Nonetheless, Emacs retains dealing with some instructions internally, specifically all ⌘ Command bindings equivalent to copy-paste. Additionally, Management+C invokes Time period mode instructions. Then again, Shift+arrow is shipped to the shell. It will be doable to have Emacs deal with it, however that is not simple on condition that it will de-synchronize the cursor place between Emacs and the shell. I do not know if there’s an Emacs bundle on the market that solves this.
If all you need is mouse help and Shift+arrow, there are zsh plugins for that:
Sadly neither handles copying the choice to the clipboard with ⌘C. The command Meta+W (Meta is often ⌥ choice, but it surely relies on your terminal configuration) copies to zsh’s personal clipboard. See [zsh copy and paste like emacs](See https://unix.stackexchange.com/questions/51933/zsh-copy-and-paste-like-emacs) for how one can synchronize zsh’s clipboard with the system.