Visit Our UNIX and Linux User Community

Use stty columns 140 in .profile on ksh

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Use stty columns 140 in .profile on ksh
# 1  
Old 01-29-2014
Use stty columns 140 in .profile on ksh


I am trying to put
stty columns 140

in .profile to set column width to 140 so I don't have to manully do it every time.
My main goal is to avoid seeing "Terminal too wide" message whenever I try to use vi editor in full screen.
I am on korn shell
echo $SHELL

So even after I added
stty columns 140

in .profile and did relogin, I still get message "Terminal too wide" message whenever I try to use vi editor in full screen.

I there any other way to do this so I don't have to see above message?

Thanks in advance,
# 2  
Old 01-29-2014
.kshrc ?
# 3  
Old 01-29-2014
Problem in using stty columns 140 in .profile on ksh

Thanks ctsgnb for your suggestion but I don't see .kshrc in my home directory but I ca see following files there:

. .forward .profile local.login
.. .functions .sh_history local.profile
.display .gostrongauth local.cshrc

I added
stty columns 140

in local.cshrc (as it's name was bit similar to .kshrc Smilie ) but even this didn't work and I still have to run
stty columns 140

manually in order to use vi editor in full screen mode. Smilie
# 4  
Old 01-29-2014
You could try using terminal extensions:-
printf "\033[8;24;140t"

Where 24 = rows,
140 = columns.
This even works on CygWin... <shock>
# 5  
Old 01-29-2014
Thanks for your inputs wisecracker.
But I tried
printf "\033[8;24;140t"

directly from my home directory and have also tried some varions like
printf "\033[8;24;140]"

but it didn't work.
So I am not sure if adding it to .profile will work either.
stty columns 140

works when tried directly from home directory but doesn't work when added in .profile
# 6  
Old 01-29-2014
i am assuming here that you have tried both methods from the command line.

Have you thought that 140 columns might be too wide for the terminal fonts size in use.

Also that the terminal must sit with ITS top left hand corner as far to the top left hand
of the desktop, (assuming a desktop of course), as possible.

What is the error report of the "printf" version?
# 7  
Old 01-30-2014
I have tried only
printf "\033[8;24;140]

printf "\033[8;24;140t"

from command line. Is there any other method of doing this?
And "printf" version doesn't show any error but seems like it doesn't work either as I still can't do vi on full screen without doing
stty columns 140


Again, thanks for your inputs.

Previous Thread | Next Thread
Test Your Knowledge in Computers #52
Difficulty: Easy
A magnetic disc array is an example of offline storage.
True or False?

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"ksh: XYZ: parameter not set" in .profile

Hi, A very basic query. I am working on two different UNIX servers and I see different behaviours for my user id. This has to be a setting in the .profile, but I can't seem to find where :confused: So, in one server if I type echo $XYZDD (a random variable), I get a blank line with no... (2 Replies)
Discussion started by: ALDonP
2 Replies

2. UNIX for Dummies Questions & Answers

STTY Columns Setting Environment Variable?

I am wondering about the following: stty columns 140 I have found that a number of times I need to set my display columns to a high number (such as 140) but I have to do this every time I login to use putty/ssh. Can we set this with an environmental variable so that it is permanent? Also... (4 Replies)
Discussion started by: newbie2010
4 Replies

3. Shell Programming and Scripting

Update ksh .profile to launch bash

Hi I don't have chsh option. I want to launch bash instead of ksh ( or launch bash from ksh .profile) how can I do this ? (1 Reply)
Discussion started by: Sivaswami
1 Replies

4. AIX

"ksh -" as login shell bypassing .profile

Hi all, I am currently trying to tell /bin/ksh to behave like a login shell. I am invoking it from an interactive shell. In the documentation is stated, that calling it with exec ksh - it should behave like a login shell, work 1st on /etc/profile, ~/.profile and so on. I tried that with... (0 Replies)
Discussion started by: zaxxon
0 Replies

5. UNIX for Dummies Questions & Answers

.profile on ksh

Hello, I've a problem with .profile on ksh. I use exceed to connect as a user to my server. When I'm connected, my PS1 variable is $, but on my .profile it is defined like PS1="`/usr/ucb/whoami`@$HOSTNAME# " ... export ENV PAGER HOSTNAME PAGER PATH PS1 MAIL Now... all my alias on... (1 Reply)
Discussion started by: gogol_bordello
1 Replies

6. Programming

How to set stty row and columns of the terminal through C program

Hi, I'm have a big problem with one of the C programs that I'm developping. actually, I'm trying to monitor the users' session in solaris. therefore, I have used the source code of the unix "script" command. but the problem is that, when i run that program, the stty settings are lost: speed... (4 Replies)
Discussion started by: saad26
4 Replies

7. Shell Programming and Scripting

KSH printf: columns and colors

Ih all, I need to make a ksh script with colors, it is possible with printf to combine column and colors ? i seem not working, I think i dont doing the good thing: printf -n "%-15s %-20s %-20s\n" "\033 the position is ok Name______Age________Site ----________---_________---- Bob... (2 Replies)
Discussion started by: wolfhurt
2 Replies

8. Shell Programming and Scripting

ksh and .profile

hi, I have the following in my .profile file: 21 set -u 22 trap "echo 'logout'" 0 23 24 25 EDITOR=vi 26 export EDITOR 27 28 export And just contains echo hello world I am in the c shell.... (9 Replies)
Discussion started by: JamesByars
9 Replies

Featured Tech Videos