Here's the technique I use:
ion-xterm:
export IS_ION_XTERM=1
exec $*
.bashrc:
if [ "${IS_ION_XTERM:-}" == "1" ]; then
if tty -s ; then eval `resize` ; fi
kill -WINCH $$
fi
This seems to work most of the time. The only time it causes problems is if I type
too soon after creating the window, before it has gotten to the resize line. In this
case, I get the message: 'resize: unknown character, exiting'. Of course, I think I
just realized I get this message when I am ssh'ing into another machine with the same
setup (since it's really hard to create a new xterm on a local machine and type
something quick enough to cause a problem, unless the machine is being bogged down by
something else, I suppose). I can probably add to the above .bashrc stuff something
that looks for one of the $SSH_* vars.
--Kevin
On Wed, Jan 14, 2004 at 12:13:24PM -0500, anders pearson wrote:
> On 2004-01-14 10:34:36 +0100, St??phane Peron wrote:
> > Hi all !
> >
> > It works !!!!
> > I have put in my .bashrc :
> > resize > /dev/null
> >
> > and now all my xterm windows are properly displayed ... for mutt, moc, vi ,
> > ....
>
> as Felix pointed out, it won't work if you run another app like mutt
> directly without invoking your shell.
>
> to handle that, i just created a small shell script called run_mutt.sh
> with:
>
> #!/bin/sh
> resize >/dev/null && mutt
>
> and in my ion bindings i have something like
>
> kpress("F10", make_exec_fn("xterm -e ~/bin/run_mutt.sh -T mutt"))
>
> so when i hit F10 i get a terminal running mutt that's been properly
> resized.
>
> just to add to the tips people have been posting...
>
> --
> anders pearson : http://www.columbia.edu/~anders/
> C C N M T L : http://www.ccnmtl.columbia.edu/
> weblog : http://thraxil.org/
--