Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using vim within a terminal. Whenever I close vim (using :q), the windows stay in the buffer of the terminal. I can type commands, but I still see the text that I was editing. I don't know how to get rid of this behaviour.

Does anybody know what I can do to change this behaviour ? In my .vimrc / terminal configuration ?

Thanks in advance

share|improve this question

migrated from Dec 7 '12 at 8:32

This question came from our site for professional and enthusiast programmers.

What are you using for the terminal? – qqx Dec 6 '12 at 21:06
how about a ctrl+l after you quit? – darryn.ten Dec 7 '12 at 10:05
I am using Terminal on mac os. – Raphael Pr Dec 7 '12 at 17:46

First of all, the 'restorescreen' option must be set (it is by default, but something might have turned it off).

:verbose set restorescreen?

will tell you. What kind of escape sequences must be sent (and whether they are understood by your terminal, whose name you unfortunately didn't mention), depends on your terminal. Check out :help 'restorescreen' for hints (and maybe try with another terminal emulator).

share|improve this answer
Unfortunatly this solution seems to work on Windows 95/NT version. I am using Terminal on Mac OS. Thanks for your help anyway. – Raphael Pr Dec 7 '12 at 17:46
Because it relies on ANSI escape sequences, this setting should work on all curses-based terminals, I think. – Ingo Karkat Dec 7 '12 at 17:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .