From: Michael Prokop Date: Mon, 24 May 2010 22:50:44 +0000 (+0200) Subject: Function asc() for roadwarriors using GNU screen and ssh. Thanks to Axel Beckert. X-Git-Tag: v0.3.82~1 X-Git-Url: https://git.grml.org/?a=commitdiff_plain;h=b36984cd736719693f754276bee529900ba22bf1;hp=fd025b6806dd26c6f27a96d7181e701983e0e7e1;p=grml-etc-core.git Function asc() for roadwarriors using GNU screen and ssh. Thanks to Axel Beckert. --- diff --git a/doc/grmlzshrc.t2t b/doc/grmlzshrc.t2t index 2e879c3..1878148 100644 --- a/doc/grmlzshrc.t2t +++ b/doc/grmlzshrc.t2t @@ -429,6 +429,12 @@ sequences) and the colors they represent. Pressing the 'asdf' keys toggles between dvorak or neon and us keyboard layout. +: **asc()** +Login on the host provided as argument using autossh. Then reattach a GNU screen +session if a detached session is around or detach a currently attached screen or +else start a new screen. This is especially useful for roadwarriors using GNU +screen and ssh. + : **audioburn()** Burns the files in ~/ripps (see audiorip() below) to an audio CD. Then prompts the user if she wants to remove that directory. You might need diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index cd1a220..430d9a7 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -2248,6 +2248,12 @@ check_com 0 || alias 0='return 0' check_com S &>/dev/null || alias S='screen' check_com s &>/dev/null || alias s='ssh' +# especially for roadwarriors using GNU screen and ssh: +if ! check_com asc &>/dev/null ; then + asc() { autossh -t "$@" 'screen -RdU' } + compdef asc=ssh +fi + # get top 10 shell commands: alias top10='print -l ? ${(o)history%% *} | uniq -c | sort -nr | head -n 10'