Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 19 Dec 2014, 17:42
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
what is it called when programs operate like man?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [11 Posts]  
Author Message
disciple

Joined: 20 May 2006
Posts: 6464
Location: Auckland, New Zealand

PostPosted: Sat 31 Aug 2013, 06:11    Post subject:  what is it called when programs operate like man?
Subject description: displaying stuff in the terminal temporarily
 

Does anyone know if there is a term to describe what programs like `man` do, where they take over your terminal to display stuff without printing to stdout, so when they are finished/exited the stuff disappears?

Thanks.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!

Last edited by disciple on Sat 31 Aug 2013, 20:38; edited 1 time in total
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2291

PostPosted: Sat 31 Aug 2013, 08:06    Post subject:  

I suspect most are just 'clearing' the screen -by printf-ing the 'clear screen character'. Others, like fsck don't clear the whole screen, but clear a single line each time the output updates and when the program finishes.
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6464
Location: Auckland, New Zealand

PostPosted: Sat 31 Aug 2013, 09:14    Post subject:  

amigo wrote:
I suspect most are just 'clearing' the screen -by printf-ing the 'clear screen character'.

Like pressing Ctrl-L ?
That's quite different from what man or less does, as you can scroll up to see the output afterwards.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
Ibidem

Joined: 25 May 2010
Posts: 527
Location: State of Jefferson

PostPosted: Sat 07 Sep 2013, 00:35    Post subject:  

I think that's a terminal emulator feature, called alternate screen switching or something like that. Basically, when a "full-screen" terminal program starts, the terminal emulator switches the buffers around; when the program exits, the terminal emulator switches it back to the main screen buffer.
In xterm, you can ctrl+middleclick to select/unselect this feature.
If you run the programs in the Linux console, you don't have alternate screen switching.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4424

PostPosted: Sat 07 Sep 2013, 04:19    Post subject:  

Those programs are in "raw mode", a bit of info is here:
http://www.tldp.org/HOWTO/Text-Terminal-HOWTO-17.html#abnormal_exit
but no code - I think dialog does the same thing (maybe all curses programs?)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Ted Dog


Joined: 13 Sep 2005
Posts: 2525
Location: Heart of Texas

PostPosted: Sat 07 Sep 2013, 07:04    Post subject:  

clear command as the last statement in a script.
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2232
Location: The Blue Marble

PostPosted: Sat 07 Sep 2013, 07:16    Post subject:  

Ibidem wrote:
I think that's a terminal emulator feature, called alternate screen switching or something like that. Basically, when a "full-screen" terminal program starts, the terminal emulator switches the buffers around; when the program exits, the terminal emulator switches it back to the main screen buffer.
In xterm, you can ctrl+middleclick to select/unselect this feature.
If you run the programs in the Linux console, you don't have alternate screen switching.


Bingo!
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#The%20Alternate%20Screen%20Buffer

You can use "tput smcup" to activate the alternate buffer, and "tput rmcup" to return to the original buffer. As Ibidem said - it won't work on linux console itself because the capability isn't supported, but on xterm and urxvt it works well.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6464
Location: Auckland, New Zealand

PostPosted: Sun 08 Sep 2013, 03:39    Post subject:  

Ah, thanks.
So here's someone circumventing it Wink
https://blogs.oracle.com/samf/entry/smcup_rmcup_hate

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2232
Location: The Blue Marble

PostPosted: Mon 09 Sep 2013, 13:41    Post subject:  

disciple wrote:
Ah, thanks.
So here's someone circumventing it Wink
https://blogs.oracle.com/samf/entry/smcup_rmcup_hate

Haven't he heard of "screen" or "tmux" (or, how about opening multiple xterm windows)?

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
Ibidem

Joined: 25 May 2010
Posts: 527
Location: State of Jefferson

PostPosted: Mon 09 Sep 2013, 21:56    Post subject:  

jamesbond wrote:
disciple wrote:
Ah, thanks.
So here's someone circumventing it Wink
https://blogs.oracle.com/samf/entry/smcup_rmcup_hate

Haven't he heard of "screen" or "tmux" (or, how about opening multiple xterm windows)?


Or Ctrl+Middleclick?
(For xterm, there are menus. You just have to press Ctrl while you click.)
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6464
Location: Auckland, New Zealand

PostPosted: Tue 10 Sep 2013, 02:12    Post subject:  

He probably thinks this is nice and simple compared to them.
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [11 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0640s ][ Queries: 12 (0.0047s) ][ GZIP on ]