altscreen is evil. If you don't know what I'm talking about, see this page for visual demonstration.

Problem is, there doesn't seem to be a way to stop it with Terminal.app (under OSX), when you're not using screen. Yes, you can edit terminfo definition, but that's rather blunt hammer. Plus that solution might break if Apple decides to update relevant term's definition in some patch. Is there some clean way to convince Terminal.app to block altscreen usage?



Terminal -> Preferences -> Settings -> Advanced

Change "Declare terminal as:" from xterm-color to xterm (or experiment with the other options...)

(worked for me with man, didn't try some of the others.)

|improve this answer|||||
  • Hmm. Looks like TERM=xterm instead of xterm-color does the trick and it doesn't cause colors to go away :) Let me play with it a bit more, to see whether there are any gotchas with that. Thanks! – yacoob Apr 25 '10 at 20:17
  • Note that this is somewhat accidental and won't solve the problem on Mac OS X Lion 10.7. The xterm terminfo file uses the latest, greatest escape sequences to switch to/from the alternate screen buffer, which Terminal didn't support prior to Lion, so it did nothing. However, Lion Terminal is now substantially more compatible with Xterm, including support for these specific escape sequences, so it will start working again. The terminfo xterm1 is specifically designed to disable alternate screen switching, so you could use that instead. – Chris Page Aug 29 '11 at 11:22
  • Lion's terminal now supports this natively in any case: ell.io/U27h – ELLIOTTCABLE Nov 24 '11 at 11:15
  • @elliottcable, the "Show/Hide Alternate Screen" menu item does not directly address this issue. It doesn't suppress the terminal control sequences, it merely gives the user the ability to manually switch which screen they're currently viewing. As in xterm, this is primarily to enable users to view and copy text from the alternate screen after a full-screen program has exited. If you're motivated to do so, you can also use it to switch screens after each time a full-screen program switches screens, but it's probably going to be annoying to someone who thinks the alternate screen is evil. – Chris Page Jan 2 '13 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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