Fork your input to multiple Terminal windows
cterm) forwards all keystrokes from a master window to multiple slave windows. Use
cterm as a method for performing ad hoc tasks, not as a substitute for automation frameworks.
This is mostly just something I wanted to do out of fun; plenty of similar solutions out there,
tmuxbeing a very popular one.
pip3 install cterm
ClusterTerminal uses the built-in Terminal application of macOS.
The most common use case is controlling multiple SSH sessions simultaneously:
cterm ssh host1 host2
In addition to the master window, the above will create two slaves windows, like so:
ssh host1 ssh host2
If you want to pass arguments to the command, include it as part of the command. Beware of character escaping where necessary. For example:
cterm "ssh -l \"some user\"" host1 host2
which will expand to:
ssh -l "some user" host1 ssh -l "some user" host2
You could've also used
cterm "ssh -l 'some user'" host1 host2to get the same outcome; I only escaped quotes to demo purposes.
Similar to a command, you can pass per-item arguments (again, beware of character escaping):
cterm ssh "\-p 1022 host1" "\-p 2022 host2"
which will expand to:
ssh -p 1022 host1 ssh -p 2022 host2
You might want to set up an alias for cluster ssh in your
~/.bash_profile. For instance,
alias cssh="cterm ssh", and then call it using
cssh host1 host2.
In an alias, you can save your normal settings, like
alias cssh="cterm --screen 2 ssh" to change the default screen.
If you specify the same argument twice, the last instance is the one used. This is useful since you may want to overwrite part of your alias, but not all of it. For example, the following will use screen 1:
cterm ssh host1 host2 --screen 2 --screen 1
The window must be completely opaque as the scripting capabilities of Terminal ignore the alpha component.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size cterm-0.0.9-py3-none-any.whl (12.0 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size cterm-0.0.9.tar.gz (12.0 kB)||File type Source||Python version None||Upload date||Hashes View hashes|