On Thu, Jul 11, 2024 at 22:43:58 +0700, Max Nikulin wrote:
> On 10/07/2024 20:55, Greg Wooledge wrote:
> >      test -t 0 && stty -ixon
> 
> I have a question opposite to the original one. Is it possible to disable
> xon&xoff for bash prompt, but enable it while foreground commands are
> running? Sometimes I use [Ctrl+s] to pause verbose output of some tool. On
> the other hand I do not mind to use forward search in readline history.

In theory... you could run "stty -ixon" in the PROMPT_COMMAND variable,
and "stty ixon" in a DEBUG trap.

The DEBUG trap is run before each command, and the PROMPT_COMMAND
commands are run before displaying the prompt.  So, it *should* work,
as long as you're aware that commands might change the terminal modes
themselves, and you aren't using DEBUG for anything else that would
interfere.

Reply via email to