How to permanently disable Ctrl-s in terminal?

To disable Ctrl-s permanently in terminal just add this line at the end of your .bashrc script (generally in your home directory)

stty -ixon

An explanation of why this exists and what it relates to can be found in this answer: https://retrocomputing.stackexchange.com/a/7266


As others have mentioned, the required fix is adding stty -ixon to your ~/.bashrc file. However, it should be protected from execution by non-interactive shells:

if [[ -t 0 && $- = *i* ]]
then
    stty -ixon
fi 

This should avoid errors when there is no TTY or interactive session in the first place, so "internal" shell invocations of desktop environments etc. will not cause error messages.


Adding to telcoM's solution, Arch's default .bashrc has this:

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

It is worth checking if your bashrc already has such checks, therefore avoiding the need for additional ifs.