Centos 5.8 and RedHat 5.3 terminals strange behaviour

Hello,

I have following problem. I have Centos 5.8 ( Final ) on Virtual Box.
I noticed very strange behavior of the terminals when resizing them.

My default shell is tcsh .

Let's assume that we have trial script try.csh with text in it:

#! /bin/tcsh -f
 
# Trial script
 
echo -n "Enter some value: "
set tmp = $<
 
if (${tmp} == "") then
echo "Only key [Enter] is typed"
else
echo "The entered value = ${tmp} "
endif
 
exit 0

If I execute the command

./try.csh

First following text appears:

Enter some value:

If now I resize the terminal nothing happens, which should be the case.

But if I execute the command

source ./try.csh

First same text appears:

Enter some value:

And now if I again change the size of the terminal the text is changed to:

Enter some value: Only key [Enter] is typed

So it seems that sourced program considers resizing of the terminal like as [ Enter ] key is typed. In the company where I work we have RedHat5.3 servers and RedHat4.7 server, on the RH5.3 this problem is also existing, which is not the case for RH4.7 ones.

Please help me to solve this issue!

Best regards,

tyanata

Your terminal emulator may be sending some sort of escape sequence to notify it that it's been resized, which the prompt wrongly accepts.

Hello Corona688,

It seems that the issue is not caused from the terminal emulator itself.
Because in Centos5.8 I have this issue using Terminal, konsole and xterm.
In RedHat5.3 I have the issue using konsole, xterm and gnome-terminal.

Best regards,

tyanata

There isn't a "make any graphical terminal emulator send a signal on being resized" global linux setting, so I still think it's the terminals in question that are responsible.

Possibly you could find out what data is being read, and modify your program to ignore that signal?

We finally gave up, and placed support ticket in RedHat. Let see what they will find.