Unix Programming - pseudo terminal input

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > June 2005 > pseudo terminal input





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author pseudo terminal input
Martin

2005-06-20, 6:05 pm

Hi everyone,

I'm having a strange problem while working with pseudo-terminals. The
problem arise when a new program reading from stdin is launched within
the pseudo-terminal. After such a program is started, the weird
sequence "^@" is echoed everytime I press a key.

For example, here is a typical session:
% ls
.. ..
% cat
h^@e^@l^@l^@o ^@w^@o^@r^@l^@d^@

Have anyone run through this kind of problem, or anything similar? Any
help would be greatly appreciated.

Many thanks!
Martin
Barry Margolin

2005-06-20, 8:50 pm

In article <IKGte.11283$5u4.35427@nnrp1.uunet.ca>,
Martin <_no_spam_please_martin@inro.ca> wrote:

> Hi everyone,
>
> I'm having a strange problem while working with pseudo-terminals. The
> problem arise when a new program reading from stdin is launched within
> the pseudo-terminal. After such a program is started, the weird
> sequence "^@" is echoed everytime I press a key.
>
> For example, here is a typical session:
> % ls
> . ..
> % cat
> h^@e^@l^@l^@o ^@w^@o^@r^@l^@d^@
>
> Have anyone run through this kind of problem, or anything similar? Any
> help would be greatly appreciated.


Looks like a bug in the program that's feeding the input to the master
side of the pty. It's apparently sending a NUL character after each
character.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Phil Endecott

2005-06-21, 8:01 am

Barry Margolin wrote:
> Martin wrote:
> It's apparently sending a NUL character after each
> character.


Could this be a character set issue? h^@ is a single 16-bit unicode
character, "h".

--Phil.


Martin

2005-06-21, 5:53 pm


> Looks like a bug in the program that's feeding the input to the master
> side of the pty. It's apparently sending a NUL character after each
> character.


You are right! I thought we had to send a null char to the master, but
I was obviously wrong!

Many thanks!
Martin
Bill Marcum

2005-06-21, 5:53 pm

On Mon, 20 Jun 2005 17:42:00 -0400, Martin
<_no_spam_please_martin@inro.ca> wrote:
> Hi everyone,
>
> I'm having a strange problem while working with pseudo-terminals. The
> problem arise when a new program reading from stdin is launched within
> the pseudo-terminal. After such a program is started, the weird
> sequence "^@" is echoed everytime I press a key.
>
> For example, here is a typical session:
> % ls
> . ..
> % cat
> h^@e^@l^@l^@o ^@w^@o^@r^@l^@d^@
>
> Have anyone run through this kind of problem, or anything similar? Any
> help would be greatly appreciated.
>

Your terminal may be sending Unicode. See what happens if you type an
accented letter, if your keyboard layout allows it.


--
I cannot believe that God plays dice with the cosmos.
-- Albert Einstein, on the randomness of quantum mechanics
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com