stty: standard input: Invalid argument

Discussion in 'Linux Networking' started by Christian Christmann, Oct 10, 2006.

  1. Hi,

    when I run an application via ssh like
    "ssh HOSTNAME xterm" I get the ssh warning:
    "stty: standard input: Invalid argument".

    Any ideas how to get rid of it?

    Regards,
    Chris
     
    Christian Christmann, Oct 10, 2006
    #1
    1. Advertisements

  2. Christian Christmann

    Lew Pitcher Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1


    Yes.

    Look through the various profile scripts that you execute when you log
    on, and change the stty commands to redirect their stderr to /dev/null
    ("2>/dev/null") . Pseudo-ttys, like the one that ssh uses, don't
    support some of the system calls (IOCTLs, etc) that stty uses, and stty
    will report on any such problems that it encounters. Directing those
    error messages to /dev/null lets the stty command do the proper thing
    when you log on to a direct-attached terminal, and not disturb you when
    you log on through ssh.

    HTH
    - --
    Lew Pitcher

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.3 (MingW32) - WinPT 0.11.12

    iD8DBQFFK6gFagVFX4UWr64RAqxhAJ9JRh8Xirz1jHa6y/jUbDbTxg69jgCeNiaE
    SRjVY6ba0Bf10vPAWKxnbjw=
    =JlXT
    -----END PGP SIGNATURE-----
     
    Lew Pitcher, Oct 10, 2006
    #2
    1. Advertisements

  3. Christian Christmann

    Chris Davies Guest

    Alternatively, only execute stuff that requires a terminal if there's
    really a terminal attached.

    This is the sort of thing I have in files such as .profile:

    if test -n "$PS1"
    then
    # Interactive stuff
    #
    stty blah blah blah
    set -o vi

    export EDITOR='vi'
    export PAGER='less'
    ...
    fi

    In case you're wondering how it works, PS1 is the shell prompt and is set
    only for an "interactive" shell. An "interactive" shell is determined
    to be one that's attached to a terminal (or pseudo-tty). Conveniently,
    ssh attaches a terminal only if it's running interactively, so it all
    matches up.

    Chris
     
    Chris Davies, Oct 10, 2006
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.