Hook up into another Terminal process? - ruby

I've got two terminal instances/processes opened with different PID.
Is it possible to from one of them, hook up into the other so when I type something and it outputs something, then the other terminal will see the output too (maybe the input too if possible?).
Just like cloning the terminals.
I want this because then I can hook up some SSH processes and everyone connected to the machine could see what the other one is doing and could also collaborate.
I don't want to use any GUI or other workarounds for this.
Want it to be in process level.
I'm using Ruby and Ubuntu.

Install GNU Screen, run screen in the first terminal, then screen -x in the second.
(This works for both input and output).

Go hack the kernel.
But if you need a practical workarou^Wsolution, I'd advise using screen.

Related

Is it possible to output on multiple terminal windows within a single program?

This question is very close to the following question:
Is it possible to output on multiple terminal windows within a single C program?
Yeah, I removed the the letter c. The above link shows how to do this on linux.
I was wondering, can this be done on windows and osx as well?
And if so how?
And also, can it work with "third party" terminals, like iTerm on osx or cmder on windows?
The language preferred to achieve this is java, but not required.
if i correctly understand, you need to create pipe to the terminal window, in order to send data to it. If found a link for you, which may help. spawning a new terminal and writing to its output

Process running when starting terminal on Mac OSX

Whenever I start terminal on my Macbook Pro it is running a process. I have to use ctrl+C to kill it. If I close the window directly it warns me that following processs are running: login, bash, bash, perl5.12.
Any idea what might be going on here and how I get back to the normal state?
I personally had this issue a while ago. First check to see if it is from one of your profiles. Assuming you are using bash, we will look at your bash profile.
First, make sure the problem is actually stemming from your bash profile. Source the scrips as follows.
source ~/.bash_profile
source ~/.profile
If after running those you observe the same hanging problem where you have to cntrl+c, then you know what script has the problem.
The best way to remedy the situation is to comment out different parts of your script to figure out where the problem is. Backup your profile and then comment out half of your profile and do a
source ~/.bash_profile
and if it hangs or not will tell you what half the problem is on. Keep repeating this until you find the problem. It sounds longer than it actually is.

Can't seem to get Node.js Command Line to interpret what I write, keeps returning "..."?

So honestly, I don't really 'get' what's going on here, I mean, can I open the regular windows cmd.exe and use node from there? Or does it have to be from the node.js command window? Can I move files around on my system using the node.js command window? And yes, I currently can't figure out how to get it to interpret what i write, although it was working perfect before, but now I cant seem to escape from '...' every line, with no response.
Thanks
I use Node on *nix, so I'm not sure if it's different in Windows. But on *nix systems, the ellipses means it's waiting on you to finish a code block or the like. You should be able to hit CTRL+C (again, might be different in Windows) to cancel out of the edit you're in or CTRL+Z to kill the REPL entirely.

How to get tabs in unix session on putty

I have used an script in past that enabled me to connect me to multiple unix machines, much like using a tab. Its just that I forgot the name of the script. Anyone know about it?
I suspect you're referring to GNU screen, which is a terminal multiplexer that allows you to have multiple virtual terminal windows in a single normal terminal window (ala PuTTY). I'd suggest tmux as a better alternative, but they're essentially the same. There are other solutions that will allow you to do tabs in the terminal client, but that depends on your OS (I'm assuming you're on Windows), and you'd have to initiate each connection individually. screen/tmux is the way to go most of the time.

Another shell open when at server?

How can I have another Terminal open when I am at my server by ssh?
I do not want to type my password twice to get another terminal for my server.
Perhaps, Bash has buffers similarly as Vim.
Check out GNU screen. It's kind of arcane and awkward to use, but does what you're looking for, and it's probably also installed on your server.
You can also forward X11 and run multiple xterm instances, but that's a pain.
Your best bet, though, is your proverbial "type my password every time" solution: you should set up SSH keys so you don't need to type your password every time and then just use multiple connections in Terminal tabs.
You can use something like GNU Screen.
The Bash shell has a feature called Job Control that allows you to run and manage multiple processes. You can read about it here: http://commandlinemac.blogspot.com/2008/12/bash-job-control-fg-bg-jobs-and-ctrl-z.html
GNU Screen
BTW. If you don't like typing passwords, try PK auth.
How it's done with PuTTy.
It's possible to use screen to open other terminals without needing to authenticate again.
Screen can also detach so that you can leave terminal open after logging out and re-attach them later. I use this on my home server for keeping rtorrent open.

Resources