octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions about the pager


From: John W. Eaton
Subject: Re: Questions about the pager
Date: Tue, 7 Nov 2006 12:11:27 -0500

On  6-Nov-2006, John Swensen wrote:

| John Swensen wrote:
| > I recently have discovered the my IDE fails when the pager is turned 
| > on.  I think I have narrowed down the problem, but need advice from 
| > someone with more UNIXy PTY experience than I.  I am using the patch 
| > that JWE pointed me to, which I  modified per the maintainers request 
| > and re-submitted to the VTE.  It allows me to make the IDE and octave 
| > the same process.  I am not 100% sure exactly how it works, other than 
| > the fact that I open a new pseudo-TTY and attach the master side to 
| > the VTE widget and run octave inside the pseudo-TTY using the 
| > following function run as a thread.
| >
| > void* octave_main_wrapper(void *dummy)
| > {
| >  // TODO: pass in the real argc, argv
| >  int argc = 1;
| >  char* argv[] = {"/usr/bin/octave"};
| >  octave_main(argc,argv,0);
| >
| >  do_octave_atexit();
| >
| >  cout << "Exiting Octave - debug CTRL-C" << endl;
| >
| >  return 0;
| > }
| >
| > The problem seems to arise when the pager is called.  I think this is 
| > because Octave is actually spawning an instance of 'less' and for some 
| > reason it is attached to the TTY of the terminal from which I ran 
| > octave, rather than being attached to the pseudo-TTY in which Octave 
| > is running.  Can anyone give some advice on this issue?  Namely, is 
| > there a way to make the pager run inside the same pseudo-TTY as the 
| > octave process.
| >
| > John Swensen
| >
| I would like to amend this statement.  In fact, the pager output does 
| show up in the VTE window, it is the input to the pager that must come 
| from the original terminal from which I launched my IDE.  So, forward, 
| back, quit, nor CTRL-C works from the VTE window, but they do work from 
| the original terminal.

Look at the source to less.  In the file ttyin.c, it opens /dev/tty to
get input from the user.  I think the reason for this is that if less
is invoked like this:

  some_command | less

then it can't use stdin to read user commands from the keyboard
becuase stdin is already connected to the source for the text it is
displaying.

Isn't the VTE widget used to implement gnome-terminal?  What does it
do to connect to /dev/tty when it has the window manager focus?

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]