Use stty columns 140 in .profile on ksh

Hi,

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
/bin/ksh

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,
Pramod

.kshrc ?

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 :slight_smile: ) 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. :frowning:

You could try using terminal extensions:-

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

Where 24 = rows,
and...
140 = columns.
This even works on CygWin... <shock>

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

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?

I have tried only

printf "\033[8;24;140]

and

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

manually.

Again, thanks for your inputs.

All is not lost yet...
Assuming you have X11 installed, as an experiment try:-

xterm /bin/bash<CR>

From your existing terminal.
Now from this second terminal try:-

printf "\033[8;30;100t"<CR>

Also:-

xterm -geometry 140x25 /bin/bash<CR>

"<CR>" for all is the ENTER key...
Keep us informed...

I tried using

xterm /bin/bash

and

xterm /bin/ksh

as I am on korn shell

echo $SHELL
/bin/ksh

but it doesn't open second terminal. So I guess I don't have X11.

Finally I am just going to give up this attempt and continue to do

stty columns 140

manually every time I log in.

Thank you for your persistent inputs, wisecracker. :o