Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to set the default rows and cols in the serial console?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
bluephoenix
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2008
Posts: 94

PostPosted: Tue Jun 30, 2015 8:24 am    Post subject: how to set the default rows and cols in the serial console? Reply with quote

Hi,

I am just using serial console (ttyS0) to maintain a server. I can only get 25*80 (rols*cols) display. I can use "stty rows 50" and use "stty cols 120" to make the display better effect. But I want to know if there is a way to set the new value in the default configuration, in kernel or somewhere?

Thank you!
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Tue Jun 30, 2015 11:14 am    Post subject: Reply with quote

Look in kernel for CONFIG_FONTS
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2468
Location: /home/zach

PostPosted: Wed Jul 01, 2015 1:46 am    Post subject: Reply with quote

My way of getting around the sizing problem with serial console was to use this:

http://cafbit.com/entry/terminal_window_size_detection_over

Not sure if it will meet your needs, but could be worth a shot.

Cheers,
Nathan Zachary
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Wed Jul 01, 2015 3:28 am    Post subject: Re: how to set the default rows and cols in the serial conso Reply with quote

bluephoenix wrote:
I am just using serial console (ttyS0) to maintain a server. I can only get 25*80 (rols*cols) display. I can use "stty rows 50" and use "stty cols 120" to make the display better effect. But I want to know if there is a way to set the new value in the default configuration, in kernel or somewhere?

Hmm one thing that springs to mind are the environment variables, COLUMNS and LINES in your shell startup sequence, eg in ~/.bashrc or /etc/profile or /etc/bash/bashrc.

I think you'd need to do the same with the stty commands, though, and that should be all you need:
Code:
Users and conforming applications should not set COLUMNS|LINES unless they wish to override the system selection and produce output unrelated to the terminal characteristics.

Users should not need to set this variable in the environment unless there is a specific reason to override the implementation's default behavior, such as to display data in an area arbitrarily smaller than the terminal or window.

I quite liked finding resize for xterm, thanks NathanZachary.
Back to top
View user's profile Send private message
bluephoenix
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2008
Posts: 94

PostPosted: Fri Jul 03, 2015 12:04 pm    Post subject: Reply with quote

Thanks for all of you!

And I want to know if I want a wider screen when I am using CRT while I want a narrower screen when I am using serial console, how should I make the configuration?

I think the bashrc and profile cannot help me.

Do you have good idea?
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Fri Jul 03, 2015 5:16 pm    Post subject: Reply with quote

bluephoenix wrote:
And I want to know if I want a wider screen when I am using CRT while I want a narrower screen when I am using serial console, how should I make the configuration?

I think the bashrc and profile cannot help me.

What have you tried?
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1746

PostPosted: Fri Jul 03, 2015 9:17 pm    Post subject: Reply with quote

You can check some variables for their contents. $TERM and $COLLUMNS are a few more obvious shots. And once you gess what you're using, you can select preffered mode with a case structure. E.g. both, local and serial $TERM is "linux" on my machine, but serial $COLLUMNS is 80 and local is 160.

You can list all variables in your shell with set command. Gives more details than env.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
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