stuck when try Ctrl-s to i-search command history in GNU Readline
Pre
Sometimes we use Ctrl-s to do a i-search command history when use GNU Readline in some programs like mysql and python.
but when I try it on a linux machine it stuck and freeze the program.
Solution
After searching on the Internet, I found the keystroke Ctrl-s has some special meaning in the linux, it is not the keybind conflict on the term of your shell or GNU Readline, it’s an issue on the term of OS.
how-to-unfreeze-after-accidentally-pressing-ctrl-s-in-a-terminal
This stop/start scheme is software flow control, which is implemented by the OS’s terminal device driver rather than the shell or terminal emulator. It can be configured with the stty command.
To disable it altogether, put stty -ixon in a shell startup script such as ~/.bashrc or ~/.zshrc. To instead just allow any key to get things flowing again, use stty ixany.
Step
with the following setting, it should work.
1 | # ~/.zshrc |