PC: CuBox-i OS: OpenSuSE 13.1 uname: Linux CuBox 3.14.14-cubox-i #1 SMP Sat Sep 13 03:48:24 UTC 2014 armv7l armv7l armv7l GNU/Linux Shell: Bash
So I was trying to see if there was a way to resize the terminal dynamically upon logging into a remote PC. How I login now is to use minicom on my PC (*or could be Putty from Windows depending on where I am) and Dial into the PC remotely. On the remote PC I have mgetty running to listen for and initialize the connection. I have mgetty configured to use TERM=vt102 as the Terminal type (*this is because this terminal produced the best result for using the screen command while dialed into this PC)...
Once I'm logged in I can see $COLUMNS is set to 80 and $LINES is set to 24.
I know I can change this by default in /etc/termcap, but who knows what size "My" terminal will be on my laptop before dialing into the PC. So I wanted to do it dynamically. I was able to successfully run the resize command which sets COLUMNS and LINES to the current window size and exports the variables after logging-in... So I was wondering if there is a way to run this automagically after logging in?
I read there is a file called "/etc/csh.login" that is supposed to get executed upon logging in, but looking over the file it doesn't even look like it would execute given the syntax of the code...
*For example, it has this in csh.login, which is not in any shell syntax I'm used to...
Given just the 1st If statement above, it fails with an error... Which got me wondering if csh.login was only for CSH/C Shell.?
Or maybe I can do something from ~/.bashrc file..?
Also, when I dial into the PC now, after I login and get the Command prompt the terminal size is working at the same physical size of the terminal window, but as soon as I use something like vi, view, man, etc... The terminal switches to 24 rows and 80 cols, which remains that way even after exiting those commands. But if the variables COLUMNS and LINES are set to what I want the size does NOT change.
But anyway, does anyone know what the best way to try and do this would be? Any thoughts or suggestions would be greatly appreciated!
You are right, bash wouldn't touch csh.login. man bash:
Quote:
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/pro‐
file, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from
the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.
When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists.
When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if these files exist. This may
be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of /etc/bash.bashrc and ~/.bashrc.
So - put your resize command in one of those and check after the next login.
Hi guys
when ever i tried to connect aix server in my institute through ssh terminal the
pop is coming like network is unreachable .Am using MacBook air
the other guys who are using putty software in windows they can easily login in tho the server through remotely . Is there any one can... (3 Replies)
Hi there, I am a newbie in AIX. I have reboot the AIX today and then the CDE login screen disappear. :eek:I have reboot several times and still it only shows the terminal (lft0) with only green characters and black screen:confused:. Anyway I can have the CDE login screen back?:confused:
Also, as... (5 Replies)
I was wondering if anyone can tell me how to log back in to unix after logging out. I have a MBPro. If I don't have the window close after exiting, then there is the phrase 'process completed' in brackets with a blinking cursor, but I can't type anything in.
Is it also possible to start the... (4 Replies)
Hi,
I am programming a script that shows a figure on screen but I would be centered, so What I have to use command to get the size of the window?
Thanks a lot, (2 Replies)
hi all ,
i need the command for remote login in to another terminal, came accross by using "tty" command. please suggest and help me out in this.
Regrds
Sridhar. (1 Reply)
I have a Solaris 8 system acting as a NIS slave. My /etc/nsswitch.conf file specifies
passwd: files nis
and in general users can login successfully. However, I have a few users who use X-terminals booted off the Solaris box and these people are unable to login unless they have entries in the... (0 Replies)
I want to enable root login just from one terminal machine, can i do that via /etc/default/login in console=/dev/console line ?
and if so what i have to type exactly, another question is it normal to edit the files inside defaults directly ? or i can copy it to /etc/ and edit it there and its... (3 Replies)
I'm trying to log in to one of my sun boxes via EXCEED's X-terminal and it won't allow me to do so as root, says not at system console, is there a way to change that so it allows logging in as root at a remote terminal? (3 Replies)