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 31 Oct 2014, 03:13
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 Posts_count  
Author Message
disciple

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

PostPosted: Sat 31 Aug 2013, 06:11    Post_subject:  what is it called when programs operate like man?
Sub_title: 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!

Edited_time_total
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2263

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: 6449
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: 502
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: 4353

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: 2389
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: 2230
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: 6449
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: 2230
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: 502
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: 6449
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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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