Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2012
    Posts
    12

    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

  2. #2
    Just Joined!
    Join Date
    Jun 2005
    Location
    France + UK
    Posts
    15
    Hi tyanata, if it is of any help I tried this on CentOS 6.2 (Redhat enterprise 6.2 without the branding). The resizing works fine with no terminal artefacts.
    I also tried on Ubuntu 11.10 - no problem there. All these under VMware workstation 8.
    So, I have no idea what the problem is and I cannot replicate it here. Hope that (marginally) helps.

  3. #3
    Just Joined!
    Join Date
    Apr 2012
    Posts
    12
    Hello sanktwo,

    Thanks for the response, the problem is that in the office our default flow in the past was with RH4.7 servers but now we are moving to RH5.3 , and most of the our configuration scripts are using menus and expressions like echo -n .... where the user should choose some thing.

    By the way, 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.

    I assume that may be some thing in ASCII codes settings is not OK, but unfortunately could not find anything similar on Google.

    Best regards,

    tyanata

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jun 2005
    Location
    France + UK
    Posts
    15
    tyanata, what window manager are you using?

  6. #5
    Just Joined!
    Join Date
    Apr 2012
    Posts
    12
    sanktwo,

    We connect our servers using VNC sessions. For window manager we can use gnome or KDE, the issue is existing on both window managers.

    In the Centos5.8 I thing that the window manager is gnome.

    By the way we tried if the same issue existing for bash, sourcing bash script containing expression like this:
    read -p "Enter some value" chosen_value

    And tried to resize the terminal. It seems that when using bash the issue is not existing. So could be that some setting of tcsh is causing the problem.

    Best regards,

    tyanata

  7. #6
    Just Joined!
    Join Date
    Jun 2005
    Location
    France + UK
    Posts
    15
    tyanata - well, sorry but I am baffled. The only thing that I can see that looks possible is an "onintr" but that assumes that when the shell gets a resize event it considers it an interrupt and terminates the read - but that sounds very unlikely - and anyway, why would it work on some versions of Linux and not others?

    It is very unlikely that ALL the window managers send a keyboard event on window resize to the shell. However, the shell can accept resize events (if compiled to do so). The manual reads:
    On systems that support SIGWINCH or SIGWINDOW, the shell adapts to window resizing automatically and adjusts the environment variables LINES and COLUMNS if set
    so in some cases it certainly takes note of resize events but why would it terminate the read on some os variants and not others?
    I presume that you have tried csh and that has the same characteristics.

    If you have not already done so it might be worth temporarily killing off all tcsh and csh startup files i.e. /etc/csh.cshrc, /etc/csh.login, ~/.tcshrc, ~/.cshrc,~/.history, ~/.login, ~/.cshdirs then you only have the compilation options to deal with.

    I am running out of ideas. I did think about downloading Centos 5.8 to see if I could replicate the problem but I don't even know if you are running 32 or 64 bit versions.

  8. #7
    Just Joined!
    Join Date
    Apr 2012
    Posts
    12
    Hello sanktwo,

    I tried the experiment with disabling of the tcsh configuration files. The issues again is there.

    Regarding my Centos5.8
    uname -a gives result:
    Linux localhost.localdomain 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 04:17:30 EST 2012 i686 athlon i386 GNU/Linux

    Best regards,

    tyanata

  9. #8
    Just Joined!
    Join Date
    Jun 2005
    Location
    France + UK
    Posts
    15

    Not reproducible on my installation.

    tyanata, OK, I have installed Centos 5.8 and done all the updating. Uname -a gives result:
    Linux localhost.localdomain 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 04:17:30 EST 2012 i686 i686 i386 GNU/Linux
    i.e. almost identical to yours except the processor type.
    I ran your command file (with the addition of the echo $SHELL to check which shell is actually in use):
    #! /bin/tcsh -f
    echo $SHELL
    # 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


    and I can resize the window without any problems i.e. the read does not terminate. I am using Gnome just like you but I am not using vnc to access it. This of course is a completely clean install. I installed "server with Gui and Gnome".

    Thus the problem is not inherent in the distribution, it is definitely something wrong with your configuration, but what? I still have no suggestions as to where to look next. Are you able try a clean install?

    I have used vnc before but it would doubtless take me quite a long time to set it up on this new installation so I am reluctant to do that. Have you any method of eliminating the possibility that it is vnc causing the problem?

  10. #9
    Just Joined!
    Join Date
    Apr 2012
    Posts
    12
    Hello sanktwo,

    I do not use VNC session for my own linux Centos5.8, I use VNC for the RedHat linux servers in the office.
    My Centos5.8 is on VirtualBox.

    If you have not the terminal resizing problem when source programs on tcsh , so may be the problem is caused by some other package installed by me in the Centos environment. In the office I have the full list of the packages installed on the my linux. Now we will have three free days because of the Eastern Ortodox Easter holidays. So when I return to work on Tuesday I will post the list of the installed packages here.

    Thanks for the help!

    Best regards,

    tyanata

  11. #10
    Just Joined!
    Join Date
    Apr 2012
    Posts
    12
    Hello sanktwo,

    As a trial I created new Virtualbox with Centos5.8. And when sourcing my script in this new fresh Centos5.8 installation ( without any other packages ), the problem is there.

    I do following in the newly installed Centos:
    1. open terminal.
    2. Execute command: tcsh
    2. Execute the command: source try.csh

    Best regards,

    tyanata
    Last edited by tyanata; 04-17-2012 at 02:15 PM.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •