irssi: remotely attach/create a screen in one line
Tue, Mar 8, 2011If you’re a big fan of irssi and you’re running it on a remote server over SSH and inside a screen, then this a tip you might be interested in.
Just put the following line inside your .zshrc
or .bashrc
file:
alias rirssi='ssh [email protected] -t screen -dRUS irssi irssi'
This simple alias will allow you to:
- Connect to your remote SSH server
- Attach to your existing irssi screen named “irssi”
- If the screen doesn’t already exist:
- create a new screen
- start irssi inside it
- attach the newly created session
Pretty cool isn’t it? ;-)
Hint from 2016
In the future we’re all using tmux now. Here’s how to do the exact same thing but using tmux.
tmux attach -d -t irssi || tmux new -s irssi irssi
The adventurous people can also combine this to mosh!
mosh [email protected] -- sh -c "tmux attach -d -t irssi || tmux new -s irssi irssi"
Tags: Archlinux, nginx, blog