LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
 
Search this Thread
Old 09-21-2013, 12:01 PM   #1
waddles
Member
 
Registered: Sep 2012
Posts: 372

Rep: Reputation: 1
How many lines showing in a window


In my script I want to know how many lines of data a users window is displaying.
I'm faily certain it isn't tput but my recollection is it is a short command name like that. Help?
This may require knowing the type of terminal a user has. How can I find that info?
 
Old 09-21-2013, 12:08 PM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959
Maybe it's just tput. Have you tried it?
Code:
tput lines
 
2 members found this post helpful.
Old 09-21-2013, 09:24 PM   #3
waddles
Member
 
Registered: Sep 2012
Posts: 372

Original Poster
Rep: Reputation: 1
I scanned the man page and from that concluded it was used primarily to set same. There is a command sequence which is used to set terminal features which I can't remember that I was thinking was what was needed so locked in and have been reminded of tput lines. I did not see the option lines in the man page can U so direct me?
AND YES I HAVE NOW TRIED IT YEA!! --Dah! A BIG thanks for that as it is exactly what I needed.
 
Old 09-21-2013, 09:32 PM   #4
Habitual
Senior Member
 
Registered: Jan 2011
Location: Pelican Bay Correctional
Distribution: I can't wait for Linux to be 'underground' again.
Posts: 3,933
Blog Entries: 1

Rep: Reputation: Disabled
tput cols gets no respect, I tell ya.
 
Old 09-21-2013, 09:43 PM   #5
waddles
Member
 
Registered: Sep 2012
Posts: 372

Original Poster
Rep: Reputation: 1
LOL I noted that cols when I scanned the tputs and thought it strange there was nothing for rows.
 
Old 09-22-2013, 07:04 AM   #6
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,156

Rep: Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844
Something I've done forever is add this to the top of my ~/.profile:
Code:
#       set up default columns and lines
COLUMNS=80
LINES=40
followed by some other stuff, then, the last lines of ~/.profile:
Code:
#       make COLUMNS and LINES the screen size
eval `resize`
Take a look at the manual page for resize, probably get you to where you want to go.

Hope this helps some.
 
1 members found this post helpful.
Old 09-22-2013, 08:28 AM   #7
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 14.1 64 Multi-Lib
Posts: 454

Rep: Reputation: 143Reputation: 143
Under my shell, a simple 'echo $LINES" displayed 37, then I resized the window and tried again and it displayed 25. So that shell variable would seem to contain the value dynamically.
 
Old 09-22-2013, 11:22 AM   #8
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, Ubuntu, Amazon Linux
Posts: 1,811
Blog Entries: 20

Rep: Reputation: 117Reputation: 117
I've always parsed the output of "stty -a" to get the number of rows and columns. Thanks for letting me know about tput. I never knew about that. Maybe that's because I never used ncurses. Now I won't need to parse (at least where ncurses is installed).
 
1 members found this post helpful.
Old 09-22-2013, 03:49 PM   #9
waddles
Member
 
Registered: Sep 2012
Posts: 372

Original Poster
Rep: Reputation: 1
Real great ideas pplz! The one I couldn't remember was stty so double thanks for that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to see all lines in the terminal window? deathcorpez Linux - Newbie 10 04-07-2013 03:23 PM
S-Video out with radeon with strange 'lines' showing hungrigerhaifisch Linux - Hardware 10 07-31-2010 03:52 PM
4 Images showing in X11 window Dinesh Taparia Linux - Software 0 06-08-2006 05:56 AM
Window decorations not showing up stonehurstX11 Mandriva 1 04-12-2005 01:57 PM
Not showing window partitions utsav_verma Fedora - Installation 2 04-10-2004 01:34 PM


All times are GMT -5. The time now is 01:58 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration