1 Answer
1

Having igncr set in the stty settings would make your terminal ignore carriage returns (and pressing return would have no effect), although hitting Ctrl+C would still reload the prompt on a new line. To temporarily reset your tty, run

stty sane

and see below for how to put this command in a file so it is executed each time the terminal is loaded, even though the defaults should already be very similar.

However, even though you mention carriage return, I think you simply mean that ^C isn't being inserted after you press Ctrl+C.

This happens when the -echoctl option of stty is set: see the full list of options at the Ubuntu manpage for stty. When a - is appended before an option, the opposite result occurs- i.e. ctrl is not echoed to the terminal. To see what non-standard options you have, just enter stty and see if -echoctl is listed:

To temporarily change the setting, so that ^C is echoed when you hit Ctrl+C you can run:

stty echoctl

However, to set it 'permanently', you can either place stty echoctl in your .bashrc or .bash_aliases or perhaps, as noted here, you can create a .stty file in your home folder and place the following in your bashrc:

stty $(cat ~/.stty)

Any other customisations can go in .stty as well, say, for example, if you wanted to reassign the stty shortcuts and have different ones from the default values.