Posted: . At: 8:37 AM. This was 3 years ago. Post ID: 15035
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



Install Twin – a Textmode WINdow environment on Ubuntu and use multiple terminals in a Virtual Terminal session.


The Twin utility for Linux allows a user to open a text-mode environment and then use multiple terminal windows within this simple environment. This could be very useful indeed when working in a Virtual Terminal. This would allow a user to watch multiple terminal windows at once.

Download the source code.

┌──[jason@192.168.1.2][~/Documents/twin]
└──╼ (master) ╼ $ git clone https://github.com/cosmos72/twin

Then build the source after moving into the directory thus created. Begin by configuring the build.

┌──[jason@192.168.1.2][~/Documents/twin]
└──╼ (master) ╼ $ ./configure

Then by building the source before installation.

┌──[jason@192.168.1.2][~/Documents/twin]
└──╼ (master) ╼ $ make

Finally, we can install the compiled binaries and libraries.

┌──[jason@192.168.1.2][~/Documents/twin]
└──╼ (master) ╼ $ sudo make install

Now the program is installed and ready to go. Just run the twin command to load it up.

┌──[jason@192.168.1.2][~/Documents/twin]
└──╼ (master) ╼ $ twin

This is what it looks like.

The twin text mode environment running in a graphical terminal.
The twin text mode environment running in a graphical terminal.

This could be very useful for watching logs in one terminal and working on something in another one. A great little utility. There are no packages for Ubuntu yet, so building from the source is the best way to install this at present. But it works very well as a text-mode application. Having multiple terminal windows open in the one Virtual Terminal session is great.

The window buttons in Twin and what they do.
The window buttons in Twin and what they do.

The image above shows what the window buttons do in Twin. You can roll windows up to save space, or drag them to resize them just like in an X11 session. This is very simple to do. You can have the windows arranged just the way you wish. Close any active terms in Twin and then click Modules->Run Socket Server. Now run the echo $TWDISPLAY command to get a colon followed by a number. Remember this number. Now run this command.

export $TWDISPLAY=:0,gz

Now close the terminal in Twin and click File->Detach. This will close the Twin window, but it still will be running in the background.

And run this command to attach to the Twin session.

┌──[jason@192.168.1.2][~/Documents]
└──╼  ╼ $ twattach --twin@:0 -hw=tty

Connecting remotely over a LAN is possible using the IP address of the remote machine. But you must copy the ~/.TwinAuth file to the remote machine to authorize the connection. But once this has been done, you can use this command to connect to a remote Twin session.

twattach --twin@1921.68.1.6:7 -hw=tty

This would make administering a remote machine very easy.

When using graphical desktop environments and terminal emulators, use Twin like this to make it look better.

┌──[jason@192.168.1.2][~/Documents]
└──╼  ╼ $ twin -hw=tty

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.