We’ve been Mac users for many years but let’s face it, Apple is starting to lose some of its shine. Sure, MacOS is better than Windows, but with each new version of MacOS it seems like more features that used to work just don’t anymore. But this article is not about MacOS and its shortcomings. However, we mention that only because we’re starting to use Linux more often, and while you can find many good replacements for MacOS software to use on Linux, one of the applications we had a hard time finding a replacement for is iTerm2. iTerm2 is described as “a terminal emulator for macOS that does amazing things.” And over the years we have found it to be far superior to any other terminal emulator we’ve tried.
There is only one issue with iTerm2 – it’s only for MacOS. The developer has never shown any desire to make it a cross-platform tool. So, for those of us that use multiple platforms, it’s not easy to use iTerm2 in MacOS and then some other terminal emulator on other platform(s). Terminal emulators tend to be a very personal choice anyway; a person who is a programmer will be looking for different features than a regular user who only uses a terminal to access his home servers. People who love using a keyboard, and who have good memories and can remember keyboard shortcuts, will be looking for a very different terminal program than those who prefer to point and click, or who need all the help they can get to work with a program. If you can barely remember the keyboard shortcuts to cut and paste text, you will not be happy with a terminal program that requires you to use such shortcuts to access all of its features.
This is where programs like iTerm2 and WindTerm shine. You can use keyboard shortcuts if that makes you happy, but if you are more comfortable with using a mouse to select various features, those programs have you covered. And, unlike iTerm2, WindTerm is cross-platform – there are versions that run on MacOS, Windows, and Linux.
WindTerm is described as “A Quicker and better SSH/Telnet/Serial/Shell/Sftp client for DevOps.” But you don’t need to be a developer to appreciate it. So why is it that you have probably never head of it before? Well, we have a theory about that, and it is that they bury the download link and the installation instructions. You need to go to their Releases page and scroll through the release notes and several graphics, none of which would be very interesting to most users, before you get to a section labelled “► Assets”, and then you may need to click on the “►” symbol to expose the actual download links. Many potential users might miss this detail and just move on to another program. And then for Linux users there is the additional complication of how to install the package – they left that little detail out of the instructions for the most recent versions, and you need to scroll all the way down to the section on version 2.4.0 to find those. Be we assume you want a more recent version, so to save you the trouble of searching, here is how you install it in Linux.
First, on the Releases page, right click on the link for the “Linux Portable” version of the program and copy the URL. We then suggest that you create a new directory named “WindTerm” in your user directory, or in a sub-directory if you prefer, and cd into it, and then use wget to download the program, for example:
wget https://github.com/kingToolbox/WindTerm/releases/download/2.6.0/WindTerm_2.6.1_Linux_Portable_x86_64.tar.gz
Then install it like this:
tar -xzvf WindTerm_2.6.1_Linux_Portable_x86_64.tar.gz && cd ./WindTerm_2.6.1 && chmod +x ./WindTerm && ./WindTerm
Both of the above examples are all one line, even if the blog formatting splits them into two or more lines. This assumes you are installing version 2.6.1; be sure to change the version number if there is a more recent version.
And that’s the other thing about WindTerm, it hasn’t been updated in the last couple of years. So while it is not really old, it also doesn’t seem to be undergoing any new active development.
When you first run WindTerm you will be presented with a popup asking where to put WindTerm’s profile directory. It doesn’t really matter which location you choose but we would put it in the application directory.
After you make this selection and click OK, you are probably still running the install script, so you may want to Ctrl-C out of that and create an application icon before you go any further. To do that, go into the WindTerm directory you created and inside that there should be another directory with the actual version name in it – on our system it’s at ~/WindTerm/WindTerm_2.6.1 – and inside that directory there is a file called windterm.desktop. Copy that file to an appropriate place on your system, this may be somewhat distro-dependent but on Debian and Ubuntu based systems it seems that ~/.local/share/applications is the correct place. Then open the copied file in a text editor (nano ~/.local/share/applications/windterm.desktop) and find the two lines that say Exec=/usr/bin/windterm and in both places change the path to the correct one (for example, /home/username/WindTerm/WindTerm_2.6.1/WindTerm). Also there are two lines that say Icon=windterm but chances are your system’s icon theme doesn’t have a WindTerm icon, so you may want to point that to the path and filename of an actual icon file of your choosing (it probably must be in .png format).
Once you do this you should be able to start WindTerm as you would any other application, but chances are at some point you will get this annoying popup. We will tell you how to get rid of it later but for now just answer “no” – in our experience answering “yes” would erase the current configuration!
After that you will see WindTerm’s main window:
The display may seem quite cluttered with panes to the right, left, and bottom of the main terminal area. But, any that you don’t use can be closed, either by clicking on the small X in the upper right corner of each panel, or by selecting “View” in the top menu bar, and then selecting “Panes”. You can select or deselect the various panes that appear. If you select “Bars” instead of “Panes” you can enable or disable certain bars, but be careful – the top choice is the Menu Bar, which is the bar you’re using, so if you disable that you lose the ability to turn it back on, or do much of anything else that you’d normally do from the top menu. If you pay attention you might notice that it shows a couple of keyboard shortcuts next to that option: Alt+W, Alt+M. What that means is if you first press Alt+W and then press Alt+M, it will toggle that top menu on or off, so if you do accidentally close it that is how you can bring it back.
One thing we have discovered about more advanced terminal emulators is that they all seem to have their little quirks and differences as to how you make connections. Unfortunately this is one case where some try so hard to make it easy for users that they actually make it more difficult. For example, if you want to set up any kind of ssh tunnel and you go looking on the web for examples, usually they will just show you an example ssh command that you enter in your system’s default shell. And when you are creating a new connection profile, iTerm2 will let you enter ssh commands verbatim if you like. But many of the newer terminal emulators make it more complicated by making you use checkboxes, dropdowns, and/or text fields to enter various ssh options. So instead of essentially cutting and pasting an example ssh command into your terminal emulator, you need to try and figure out how to translate those commands into the proper checkboxes, dropdown menu selections, and/or text fields. And if you’ve only ever set up ssh connections using checkboxes and dropdowns, what do you do if you ever need to use a different terminal emulator that has different checkboxes and dropdowns, or none of those?
I wish I could tell you that WindTerm makes this easy, but it really doesn’t. Setting up a basic SSH connection profile (WindTerm calls it a session) isn’t difficult; you just click on Session in the top bar, then New Session (or press Alt+N) and a popup window will let you enter the details for your ssh connection.
In the popup that appears, select the SSH tab, then enter your host address in the Host field, and the name of what you’re connecting to in the Label field. For most servers that is all you need to enter on that screen, although you can change some other things such as the port number used if that’s non-standard. But once you have that filled out, you may be wondering, where do I put the user name? And that’s where things start to get a little, well, strange. What you do is click the Connect button and a new pane will pop up where you can use “OneKey” to log in, or you can click the Account tab and then a field will appear where you can enter your user name, and there is a checkbox to “Auto login next time” that you will probably want to check unless you are in an insecure environment. Then click “Continue”:
Then if this is the first time you have created a new session, you will probably get this popup asking you to enter a master password that will be used when you want to perform certain operations in WindTerm. Unless you are in an insecure environment, you might want to leave both fields empty and just click OK, so you aren’t bothered by this again.
Then yet another box pops up asking for your password. You can fill that in and login that way if you like:
However, if you want to use key exchange you can click the Public Key tab, and it will ask you for the path to your identity file. Click the “…” and it will open the file picker dialog and let you choose the file. For nearly all users this will be .ssh/id_rsa so select that and click Continue and you will be logged in, and you new session will appear in the Session pane if you have it visible.
Just about every other terminal manager we have ever used knows where to find the identity file but WindTerm will ask you to enter it for every session you create. Fortunately you only need to do this once for each session you create, as long as you remember to check that “Auto login next time” checkbox.
Your saved sessions all appear in the Session pane on the right hand side of the screen. Clicking on a session will start that session in a new tab, the same as would happen if you clicked on an item in iTerm2’s Profiles pane on a Mac. Note that you can create, remove, or rename folders (called Session Groups in WindTerm), or not use any Session Groups at all if that’s your preference. You create a new Session Group by right-clicking on any session and selecting “Move to…”; you can specify an existing Session Group or create a new one. You can right click on a folder or session to remove or rename it. The screenshot below also shows how panes can be closed to give a less cluttered look:
Creating ssh tunnels is also, well, interesting. In iTerm2 you would just create a new profile for each tunnel (at least that is how we would do it) and enter the ssh command and its options. In WindTerm you need to already have a session for making a basic ssh connection to the target server, as described in the previous paragraph. You then click on “Tunnels” in the top menu bar (next to the magnifying glass icon on the right hand side) and then in the dropdown you click “Tunnel Settings” Or you can press Ctrl+T followed by Ctrl+U.
That will bring up the Tunnel Settings popup, and you can create new tunnels by clicking the small + near the bottom left of the popup. Under Type you can create Dynamic, Local, or Remote forwarding tunnels.
Dynamic tunnels are commonly used to set up a SOCKS5 proxy, but unfortunately there is a bug in WindTerm, in that if you create a Dynamic proxy and then try to use it with your web browser, and you tell your browser to use the proxy for DNS lookups, you won’t be able to connect to anything because for some reason the DNS lookups do not pass through WindTerm. That has not been an issue with any other terminal emulator we have tried.
Fortunately there is a workaround, though it’s not pretty. What you do is create a new session, but instead of selecting a SSH session you select the Shell tab at the top of the new session dialog. In the Label field add a descriptive name for your tunnel. Then simply click Connect. Then you go into the Tool item in the top menu bar and select Triggers (or hit Ctrl+T twice). In the popup box that appears, click the + in the lower left corner to create a new trigger. The name and description can be whatever you want, but set the type (in the dropdown menu) to Event: After Connection and click the Create button.
In the next screen select “Send Text” in the dropdown and a text field will appear, in that text box you put your full ssh (or autossh if you have that installed and want to use it) command and add the \n characters at the end so it will enter the command you type. So for example you could enter something like
/usr/bin/ssh user@example.com -D 9876\n
to set up a regular SOCKS proxy on port 9876. Or if you have autossh installed, then something like
/usr/bin/autossh -M 0 user@example.com -D 9876\n
to make the tunnel attempt to stay connected even if there is a temporary outage. Note you should use the correct paths to ssh and/or autossh on your system. Then, click the Sessions tab at the top of the dialog and you should see switch icons next to all your saved settings. Click the one next to the new shell session you just created, that has the descriptive name for your tunnel. Then click the OK button.
What will happen now in any time you start that shell session, it will run that ssh command and open the proxy. And for whatever reason, DNS lookups that go through the proxy work if you do it this way.
You can have up to four sessions open automatically any time you start WindTerm (well, sort of). Go to Session in the top menu bar, then Preferences, then Settings. You will see a box pop up where you can select “A specific set of sessions” to run at startup, and you just click that option and select the sessions you want in the dropdowns.
Why only four sessions? Only the developers know. And the worst part is they don’t all actually start, only the first one does. For the rest it brings up the sessions in tabs, but they don’t actually make a connection when you click on the tabs. That is bad if you are trying to use WindTerm to start a tunnel or proxy automatically at startup. iTerm2 will start sessions in tabs that you have set to open at startup. And we haven’t found any way to change that behavior in WindTerm, unfortunately.
There is a place on WindTerm’s GitHub site where they have several short how-to documents with accompanying animated gif’s that show how to use many of WindTerm’s features. They are shown in reverse chronological order here. The only problem is that, at least on our systems, the animations go by so fast it is hard to see what they are doing, If you search online there are many ways to slow down an animated gif, but we found that if we let one of them loop through about three or four times we finally caught the gist of it. At least they made the effort to actually create some user-friendly documentation.
We said we’d tell you how to get rid of that annoying “Reimport Shell Sessions” popup that pops up every time you start WindTerm, if it appears in the version of WindTerm you are using. The solutions are found in issue #2287 in WindTerm’s bug tracker. There are two solutions shown and only one of them is valid on any given system. One is that open ~/.wind/profiles/default.v10/user.config in a text editor and find the setting “terminal.reimportShellSessions” and change the value of that setting to 2 (so it reads “terminal.reimportShellSessions” : 2). But if that setting does not exist, DO NOT CREATE IT or you will lose your entire configuration! Instead, go to the directory where you saved WindTerm when you installed it, and in there go into the /global directory and find the file wind.config and open that in a text editor. In there you should find a setting, “terminal.reimportShellSessions”: true, and if so change the “true” to “false“, being careful not to accidentally delete the comma at the end of the line. Whichever setting you change, save the changed file and when you next start WindTerm the annoying popup should be gone!
https://twosortoftechguys.wordpress.com/2024/09/11/windterm-a-possible-cross-platform-alternative-to-the-iterm2-terminal-emulator/
#000000 #2287 #iTerm2 #Terminal #TerminalEmulator #WindTerm