Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I don't always accidentally more a binary file, but when I do, I manage to output weird characters that (apparently) change the character set used by the terminal and make it difficult to read or simply unreadable.

Is there any option other than closing the terminal window to fix this option?

share|improve this question
7  
Forgive me, but I your wording inspired me to make this: http://i.stack.imgur.com/xfuX6.jpg :P –  iglvzx Mar 15 '12 at 19:19
    
On a more serious note: You should be able to press Q to exit the more command. After that, using cls to clear the screen -- as @sidran32 suggested -- should do the trick! –  iglvzx Mar 15 '12 at 19:37
    
@iglvzx I didn't accidentally that phrase, I that phrase on purpose. :) –  Jordan Reiter Mar 15 '12 at 20:13
add comment

3 Answers 3

up vote 3 down vote accepted

Assuming this is Linux or some other Unix that uses VT100 like terminals:

The easiest way

reset

which will reset the terminal settings.

echo [Ctrl+V][Esc]c

works most of the time too.

If the problem is that the display is mangled because it switched to a different (symbol) character set, you can add a SO control character to your prompt to automatically switch back, or run your terminal inside GNU screen which will do similarily.

share|improve this answer
    
If you are using PuTTY, it has a convenient "Reset Terminal" option in the menu bar context menu. –  ultrasawblade Mar 15 '12 at 19:34
    
Ran into the same problem; echo [Ctrl+V][Esc]c worked! So sometimes reset does nothing. –  Jordan Reiter Oct 2 '12 at 18:56
add comment

The reason this happens is because some characters will move the cursor around the screen instead of outputting a character, which means you'll end up printing over existing text in seemingly random spots in the terminal or changing other settings (for instance, some Linux terminals will change the title of the window if you enclose the new title between designated non-printable characters specified by their ASCII codes, in an echo statement). Usually just doing a more or a less won't cause that issue, in my experience. All I usually do to get a sane terminal again is to just hit enter a few times to get to a clear line, or use the cls or clear command to clear everything out and get things back to normal.

share|improve this answer
    
No, as mihi said before, it switches to a different set. Hitting and returning does nothing. –  Jordan Reiter Mar 15 '12 at 20:12
1  
Your question is not specific enough, then. "Messing up the display" could mean the symptom I described, which is what I see most commonly, or something else. If it is a specific issue, then please describe it more clearly in your question, or (even better) post a screenshot of the issue. –  Ben Richards Mar 15 '12 at 21:24
add comment

to get your normal screen back try this:

echo ^O

echospacectrlvctrlo

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.