Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

After running cat on some files I get the infamous 'bushes': ␌⎺└⎻⎼␊⎽⎽␊␍ ├▒⎼ °␋┌␊. B␊├├␊⎼ ┤⎽␊ ├▒⎼'⎽ ≥ which I believe are result of encoding being changed. Is there any way to recover the terminal after the encoding has changed?

share|improve this question
add comment

2 Answers

up vote 10 down vote accepted

Run reset. From the man page:

When invoked as reset, tset sets cooked and echo modes, turns off cbreak and raw modes, turns on newline translation and resets any unset special characters to their default values before doing the terminal initialization described above. This is useful after a program dies leaving a terminal in an abnormal state.

share|improve this answer
add comment

tput sgr0, tput rmacs, or tput reset. reset is usually but not always even more complete than tput reset. (Turn off all special output modes; turn off alternate character set, which is usually but not always included in sgr0; send terminal reset string which often does those and more.)

It can be useful to embed tput sgr0 at the beginning of $PS1.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.