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

Re: multi-gnome-terminal alternative



On Wednesday 03 January 2007 10:32, Kamaraju Kusumanchi wrote:
> On Wednesday 03 January 2007 10:21, Sven Arvidsson wrote:
> > On Tue, 2007-01-02 at 14:02 -0500, Kamaraju Kusumanchi wrote:
> > > I really miss one feature from all these applications. I would like
> > > to have two terminals open side by side. All the input goes to one
> > > terminal, all the output (and errors if there are any) comes up in
> > > the second terminal. Clicking on a command in the first window should
> > > execute the command again. The whole thing looks similar to MATLAB's
> > > interface.
> > >
> > > Is there any terminal emulator which provides this kind of facility?
> >
> > You don't need a special program for that do you?
> >
> >  echo helloworld &> /dev/pts/1
> >
> > This will redirect output, both normal and error messages from one
> > terminal to another. You can list the terminals and their TTY you have
> > open by typing "w".
>
> That is pretty cool to know. Thanks. But this requires
> appending "&> /dev/pts/1" to each and every command. Can this be done in
> some configuration file so that it works for each and every command?

You can rig something pretty quickly like this:

1. Open two terminals.
2. In the "output" terminal, run 'ps' to find out the shell pid.
3. Use lsof -p <pid> to find out the pts that the pid is using.
4. In the "input" terminal, run bash &> /dev/pts/xxx to start a shell and
   redirect everything to the "output" terminal.

If you want typed commands to be also echoed on the "input" terminal, you 
might have to fiddle with the stty settings.

-- 
Wesley J. Landaker <wjl@icecavern.net> <xmpp:wjl@icecavern.net>
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2

Attachment: pgp_TYQYVMw36.pgp
Description: PGP signature


Reply to: