简体   繁体   中英

Ctrl+p causing bash to temporarily hang when in vi insert mode over ssh

I recently switched to using vi mode ( set :o vi ) in my bash terminal. In the past, I've always used ctrl+p to look through previous commands, but for some reason after switching to vi mode bash hangs for about 20 seconds or so when I press ctrl+p in insert mode.

Note, this only happens over ssh. Locally it just inserts ^P .

Does anyone know why this is happening, or how I can hack it to remove the ctrl+p shortcut from OS X Terminal (I'm happy with using ESC, k, k,... )?

Thanks

In insert mode, ^P is bound to menu-complete-backward , so it's running through all of bash-completion, which takes a while. If you want to cycle through the command history, you need to leave insert mode and use k and j . You could also bind ^P to previous-history .

In the OS X version of bash (which uses BSD libedit instead of GNU readline), ^P in insert mode doesn't do anything.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM