Re: Xterm Oddness
Re: Xterm Oddness
- Subject: Re: Xterm Oddness
- From: Matt Martini <email@hidden>
- Date: Mon, 8 Feb 2010 14:28:29 -0500
On Feb 8, 2010, at 1:27 PM, Chip G. wrote: Matt, Thanks for the reply. On Feb 8, 2010, at 13:10, Matt Martini wrote: In .bashrc you should have this line:
shopt -s checkwinsize # check window size after process complete
I know it may irritate some, but I had problems with this whole bashrc/bash_profile thing. Eventually I moved to put everything in bash_profile and I have bashrc source bash_profile. I added the line you recommend but it made no difference. I'm looking into that some more to see if I can understand it.
It doesn't matter too much, I like to keep my interactive stuff (aliases, ...) separate from my general env stuff. Actually, I use a more complex setup where I have a bunch of bashrc files based on OS, and machine name that get sourced on login. The second thing is a hard to find gottcha, if you setup your prompt (PS1) to use colors (or other escape sequences) you need to
make sure that you escape the expressions otherwise bash will not count the number of characters on the line properly and you will
get the strange line wraps that you described.
So you should have:
PS1='\[\033[1;34m\]\h.\u\[\033[0m\] \$ '
instead of
PS1='ESC[1;34m\h.\uESC[0m \$ '
My PS1's look like this: PS1='$(date +%H:%M) \[\033[0;33m\][\u@\h:\[\033[0m\]\w\[\033[0;33m\]]\[\033[0m\] \$ '
I have a bunch of them in a case statement that matches which platform/host I'm logged into. This allows me to have one file on all my machines but a different prompt based on the machine. These were like this before.
This prompt seems ok to me. BTW, on some linux systems the window size doesn't register properly (noticeable by a vim screen that doesn't take up the whole window)
and you can use the following to resize the window to the size you want:
printf "\e[8;67;96;t" #where 67 is the height and 96 is the width
Would this be true for a Mac system? That's odd. This works. It works in X11 and it even works with Terminal.app. OK, so how do I set this up as a conditional in my bash_profile/bashrc to check for X11 and output this code to adjust the screenwidth?
I use this on a mac using both X11 and Terminal.app. Here is what I have:
if [ "$TERM" = "xterm-color" ]; then printf "\e[8;47;94;t" fi
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden