This how I personally use the combination of the above software, comments are welcome.
I use my own patched version, with an icon (makes it easier to spot).
Turned unicode on, using SSH keys with Pageant so my laptop suspend patch works (make sure automatic username entering is on).
I've configured the session so that it'll auto-reconnect to screen with a seperate script (so if I want to change it I don't need to update 5 configs on different
machines, etc) like this:
#!/bin/bash screen -DRSU irssi irssiMinimisation award goes to yatesy.
Isn't much to go here, the default setup is fine for just about all purposes.
Something of interest may be my little ssh-tunnel program:
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <sys/signal.h>
#include "options.h"
#include <sys/fcntl.h>
pid_t child = 0;
void handler(int signal) {
if(child > 0) {
kill(child, SIGKILL);
child = 0;
}
exit(0);
}
int main(void) {
int fd;
if(fork())
exit(0);
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);
fd = open("/dev/null", O_RDWR);
if(fd < 0)
exit(0);
if((dup(fd) < 0) || (dup(fd) < 0))
exit(0);
if(setsid() == -1)
exit(0);
signal(SIGKILL, handler);
signal(SIGTERM, handler);
while(1) {
child = fork();
if(child == 0) {
execl("/usr/bin/ssh", "-T", "-q", "-N", "-L", LOCAL, REMOTE, 0);
exit(0);
} else if (child != -1) {
if(waitpid(child, NULL, 0) == -1)
exit(0);
} else {
exit(0);
}
child = 0;
sleep(10);
}
return 0;
}
Here's the contents of my .screenrc file:
terminfo xterm|xterm-color|xterm-xfree86|rxvt hs:ts=\E]0;:fs=\007:ds=\E]0;\007 msgwait 2 msgminwait 0 vbell off nonblock onThe terminfo line allows the xterm title escaping to 'go through' the screen session to PuTTY.
Non-blocking mode makes sure when your connection dies, your screen session won't block ('hang').
These lines in your /etc/ssh/sshd_config also seem to help with this problem:
ClientAliveInterval 5 ClientAliveCountMax 3
blockn script exec \@b = split /:/, "$*", 2\; Irssi::active_win->command("msg O block -h $_ 1d $b[1]") foreach(split / /, $b[0])
checks script exec Irssi::active_win->command("check $_") foreach(split / /, "$*")
cidr exec - /usr/bin/perl -we 'use Net::CIDR\; foreach (split / /, "$*") { print join(" ", Net::CIDR::range2cidr("$_")) . " " }'
suspenduse script exec \@b = split /:/, "$*", 2\; Irssi::active_win->command("msg Q suspenduser #$_ $b[1]") foreach(split / /, $b[0])
wallusersp script exec Irssi::active_win->command("wallusers $_") foreach (split /\\n/, `$*`);
Note you NEED to be careful with what you feed these aliases, most notably with any escape characters. I don't know a way round this, please contact me if you do!