PDA

View Full Version : typing in two terminals at the same time




benjoshua
Nov 21, 2010, 12:51 PM
hello everybody!
is it possible to open two terminal's windows and after some time, be able to type in one window and it will automatically will happened in the other? it will be extremely handy for my using the diff command to test my projects...

can anyone help?
thanks!



chown33
Nov 21, 2010, 02:20 PM
Not possible as described.

Two windows is easy: choose New Window from Terminal's Shell menu.

You can copy and paste commands into a Terminal window. You can even copy commands from one window and paste them into another. Or enter commands in any text editor (TextEdit with a Plain Text window open), then copy and paste them into Terminal windows. Or select in TextEdit and drag-n-drop to Terminal windows.

For anything more than simple commands, I almost always edit in a text editor, then drag-n-drop or paste into a Terminal window. You can build up sets of commands quite easily, and store them in text files associated with a project. Remember to write comments with your commands so when you come back next month you know what the commands do.

holmesf
Nov 21, 2010, 03:25 PM
hello everybody!
is it possible to open two terminal's windows and after some time, be able to type in one window and it will automatically will happened in the other? it will be extremely handy for my using the diff command to test my projects...

can anyone help?
thanks!

Yeah, it's not really possible, not easily anyway. Each terminal window acts like its own session. Every application run by the terminal is owned by that terminal process. To get any communication you'd have to set up some inter-process communication. This could be accomplished through a socket, but using unix at this level is beyond me.

BertyBoy
Nov 21, 2010, 04:29 PM
hello everybody!
is it possible to open two terminal's windows and after some time, be able to type in one window and it will automatically will happened in the other? it will be extremely handy for my using the diff command to test my projects...

can anyone help?
thanks!

If you explain in more detail what you want to achieve ...

We've picked up something about running diff. Do you want to send output to the other terminal ? or run the same diff (for whatever reason) in the other terminal at the exact same time ? Or do something completely different ?

jared_kipe
Nov 21, 2010, 08:25 PM
I immediately thought of CloneKeys, but it seems it doesn't work between two windows of the same application. However if you used two different applications CloneKeys should be able to do it. Say by duplicating Terminal.app maybe.

wlh99
Nov 22, 2010, 01:22 PM
Is it possible to redirect the output of a command to a differnt tty? Never tried it, but I would think it would work.

Something like:

somecommand some_arguments > /dev/tty01

Where /dev/tty01 is the tty of the other xterm running.

BertyBoy
Nov 22, 2010, 02:16 PM
Is it possible to redirect the output of a command to a differnt tty? Never tried it, but I would think it would work.

Something like:

somecommand some_arguments > /dev/tty01

Where /dev/tty01 is the tty of the other xterm running.

I was thinking of a variety of possibilities, from using a form of the "write" command, to using a named pipe and maybe tee.

But let's see what the OP actually wants to achieve. Whatever, it should be do-able on real Unix, and hopefully just as easily in OS X Terminal.

lee1210
Nov 22, 2010, 02:23 PM
<snip>it should be do-able on real Unix, and hopefully just as easily in OS X Terminal.

There is no distinction, OS X is UNIX...
"POSIX-compliant, Open Brand UNIX 03 Registered Product"

From: http://images.apple.com/macosx/technology/docs/L416017A_UNIX_TB_FF.pdf

As for the OP... he hasn't been back to the forums since he made this post. For the last day people have been taking stabs, but it seems at this point that the suggestions need to be read and he needs to clarify what he wants if the current set of replies don't work.

-Lee

elppa
Nov 22, 2010, 06:31 PM
Just to back up the previous point: given the long and complex history of Unix and given Apple have got Mac OS X 10.5 on intel and Mac OS X 10.6 officially certified as Unix (http://www.opengroup.org/public/prods/apple.htm), I too am curious to know what people mean when they say “real Unix”.

And I'm not talking specifically to BertyBoy. People describe ‘Unix’ and Mac OS X as if they are different things.

BertyBoy
Sep 13, 2013, 07:04 PM
OK, 3 years late, but trying to answer your query as to what many consider "real Unix", and it should help avoid confusion in the future.

"real Unix" is the SVR4 (or whatever release it was at when you started to use it) Unix.
BSD Unix, which was always referred to as Unix-like, was not part of this. And I believe Mac OS is more a BSD derivative than SVR4.

That's just the way things were when I started on "real Unix" in 1984 - same time I started on Mac, and VMS. We just never referred to our BSD machines and SunOS machines (from end 1986) as Unix.

I'm the same today, Linux is linux, never Unix. AIX is AIX, Solaris is solaris.

subsonix
Sep 14, 2013, 08:49 AM
OK, 3 years late, but trying to answer your query as to what many consider "real Unix", and it should help avoid confusion in the future.

But to be honest unless mentioned in a historic context do you really think many refer to the actual OS once called UNIX.

Today it's a standard maintained by the Open Group, which if met ensures Unix compatibility. By that definition AIX, Solaris and OS X are all certified Unix and systems that does not meet the standard are Unix like.

http://www.opengroup.org/openbrand/register/

northerngit
Sep 14, 2013, 04:48 PM
Hi,

Hopefully I've understood your requirement! You want to have multiple terminal windows open, and simply replicate input to stdin on one, to the other?

Depending on whether you are SSH'ing to another machine, or working locally, dictates a likely solution.

iTerm2 (http://www.iterm2.com/) - You can send keyboard input to multiple tabs

CSSHX (https://code.google.com/p/csshx/) - csshX is a tool to allow simultaneous control of multiple SSH sessions. A master window will also be created. All keyboard input in the master will be sent to all the slave windows.

Or the venerable Cluster SSH http://sourceforge.net/projects/clusterssh/

Example usage instructions on combining ClusterSSH and CSSHX -

(http://eric.lubow.org/2010/system-administration/cluster-ssh-with-csshx/)

Hope this helps!

subsonix
Sep 14, 2013, 05:13 PM
Hi,

Hopefully I've understood your requirement! You want to have multiple terminal windows open, and simply replicate input to stdin on one, to the other?

It's a 3 year old thread that was awaken from the dead today. Redirecting stdout to a tty device works as suggested previously, for diff it's possible that splitting the screen (upper right corner in Terminal) would be sufficient, but the OP never returned to explain what exactly he wanted to achieve.