LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-08-2010, 02:11 PM   #1
crontab
Member
 
Registered: Jun 2005
Distribution: Various
Posts: 72

Rep: Reputation: 15
Question bash auto-clearing the screen when closing application?


This is just a dumb little thing that I've wondered for years how it works and how I can change it. For example, opening a document with vim, or opening a man page, and then exiting out of it will sometimes (depending on the distro) clear the screen and leave your prompt at the very top... other times, it leaves the contents of whatever you had open on-screen and your prompt is at the bottom.

I prefer the latter, so I hope someone has the answer to this elusive mystery.
 
Old 03-08-2010, 02:39 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
To acheive the first you just issue a 'clear', i tend to like to issue a 'reset' also for my own personal use scripts.

The later i don't believe is as easy as a simple command, but it is behavior that can be performed via c. In retrospect I'm surprised there's not some kind of save and restore terminal state commands for bash to perform that functionality.

Edit: if memory serves me this is actually handled by the terminal and thus requires an escape code to be sent, however the exact code would likely depend on your terminal and I'm unaware of any program that does a variety of them for various terminals.

Last edited by rweaver; 03-08-2010 at 02:44 PM.
 
  


Reply

Tags
bash, clear, prompt



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
auto closing console ? Bob Armstrong Linux - Newbie 7 08-04-2008 01:36 PM
Auto detect a closing connection helpmhost Linux - Networking 4 01-23-2007 02:08 PM
Firefox current seems to be kind-of-auto-closing johnnydangerous Fedora 2 03-08-2005 11:25 PM
closing an application from a c program roush Programming 4 04-30-2004 04:14 AM
When closing my graphics program & entering the application again the screen is blank armesk Programming 7 08-29-2003 01:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration