17
5
I am using bash 4.3.11(1) and have the following history plugin installed (via .bash_it):
# enter a few characters and press UpArrow/DownArrow
# to search backwards/forwards through the history
bind '"^[[A":history-search-backward'
bind '"^[[B":history-search-forward'
When I log in to an interactive session all is well but when I run remote commands via ssh host 'ls -als'
for example, I see the following output:
: ssh host 'ls -als'
/home/ubuntu/.bash_it/plugins/enabled/history.plugin.bash: line 3: bind: warning: line editing not enabled
/home/ubuntu/.bash_it/plugins/enabled/history.plugin.bash: line 4: bind: warning: line editing not enabled
When I modify the history plugin with echo -e '\0033\0143'
after each bind call I no longer get the warnings but my console is cleared. Not a huge drawback but it would be nice to know a cleaner way to suppress this for remote commands.
# Works, but annoyingly clears console
# enter a few characters and press UpArrow/DownArrow
# to search backwards/forwards through the history
bind '"^[[A":history-search-backward'
echo -e '\0033\0143'
bind '"^[[B":history-search-forward'
echo -e '\0033\0143'
1Actually this answer is incorrect, see @alexander-vorobiev's answer below. – Ahmed Masud – 2019-07-06T19:41:04.397