Thursday, May 9, 2024
17
rated 0 times [  17] [ 0]  / answers: 1 / hits: 17578  / 2 Years ago, sat, december 11, 2021, 10:17:39

In the readline manual



# man readline


The following describes how to search backward and forward.



reverse-search-history (C-r)
Search backward starting at the current line and moving `up' through the history as necessary. This is an incremental search.

forward-search-history (C-s)
Search forward starting at the current line and moving `down' through the history as necessary. This is an incremental search.


When I hit ctrl+r and type "apt-get", I'm able to do a reverse-search-history by continually tapping ctrl+r. But then I tap ctrl+s and the terminal does not go forwards. Am I doing something incorrect?



Also what key does the Meta prefix "M-" represent?


More From » command-line

 Answers
7

The sequence C-s is taken from the terminal driver, as you can see from



stty -a | grep '^S'


To free up the sequence for use by readline, set the stop terminal sequence to some other sequence, as for example



stty stop ^J


or remove it altogether with



stty stop undef


After that C-s would work in the given terminal.



Set it in ~/.bashrc to make it work in every terminal.



The M- sequence means the Alt key, as already noted.


[#43603] Saturday, December 11, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nstitutencert

Total Points: 171
Total Questions: 126
Total Answers: 124

Location: Azerbaijan
Member since Fri, May 12, 2023
1 Year ago
nstitutencert questions
Fri, Dec 10, 21, 16:31, 2 Years ago
Tue, Apr 19, 22, 05:51, 2 Years ago
Wed, Jan 26, 22, 07:52, 2 Years ago
Sun, Aug 29, 21, 21:43, 3 Years ago
;