Pseiudo Terminals

G

garycubitt

Hi all,

I'm new to this group and I'm not sure if this is the right place to
be posting this question - so if this is the wrong place please could
you point me in the right direction.


The problem I'm having is as follows:


I have designed a perl script that acts as a wrapper to the sybase
command line querying tool sqsh. The wrapper uses pwp to
automatically log in to the sqsh process and allow the user to
interact with it through the perl script. The problem I have is that
the terminal configuration does not seem to follow through to the
pseudo terminal. For example if a sql query is entered that is
longer
the 25 chars and then the backspace key is used or the left arrow to
go back the line will start to move up the screen and will not flow
as
expected. Also from within sqsh it is possible to use vi, however
when I use vi nothing is visible until a (L) over the text and then I
can see it.


I'm really have no idea where to go to look for a possible solution
to
this - or even what may be causing it so I thought I'd give you guys
a
try!


The script uses the perl Comm.pl module to create the pseudo terminal
and start the child sqsh process.


Thanks
Gary
 
J

Joe Smith

the terminal configuration does not seem to follow through to the
pseudo terminal. For example if a sql query is entered that is
longer the 25 chars and then the backspace key is used or the
left arrow to go back the line will start to move up the screen
and will not flow as expected.

I had a problem like that. Turns out the system thought my terminal
was 80 lines tall and 25 columns wide, instead of the actual 25 x 80.

To check what your program sees:

print 'ENV vars for controlling process:',
' LINES=',($ENV{LINES}||'undef'),
' COLUMNS=',($ENV{COLUMNS}||'undef'),"\n";

Then send these commands to the PTY:

echo On the PTY, LINES=$LINES COLUMNS=$COLUMNS
stty size ; stty -a'

If %ENV is correct, you could send this command to the PTY:

stty rows $ENV{LINES} cols $ENV{COLUMNS}

This very problem is why I have

set noglob; eval `resize -c`; unset noglob

in the keyboard-interactive section of my .login file.

-Joe
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top