[Bash-completion-devel] [PATCH] screen: Omit pid when listing sessions
Alexey Zaytsev
alexey.zaytsev at gmail.com
Mon May 16 20:46:13 UTC 2011
Signed-off-by: Alexey Zaytsev <alexey.zaytsev at gmail.com>
---
Hi.
When running multiple screen sessions on a busy machine, the pid part
would normaly get into the completions way. Luckily, screen does not
require it when manipulating a session.
The only drawback I see is if you are running two or more sessions with
the same name, the completion would show both sessions, and screen requires
the pid in this case. But I doubt this is a major use case, and screen
fails gracefully here:
$ screen -x s2
There are several suitable screens on:
21843.s2 (05/17/2011 12:33:23 AM) (Attached)
20731.s2 (05/16/2011 11:35:07 PM) (Attached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
Tested with both named and non-named sessions. To be honest, tested
with 1.2-3 from Debian squeeze, but it seems trivial enough to not worry.
completions/screen | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/completions/screen b/completions/screen
index e370c8e..eb55415 100644
--- a/completions/screen
+++ b/completions/screen
@@ -5,7 +5,8 @@ have screen || return
_screen_sessions()
{
COMPREPLY=( $( compgen -W "$( command screen -ls | sed -ne \
- 's|^\t\{1,\}\([0-9]\{1,\}\.[^\t]\{1,\}\).*'"$1"'.*$|\1|p' )" \
+ 's|^\t\{1,\}\([0-9]\{1,\}\.[^\t]\{1,\}\).*'"$1"'.*$|\1|p' | \
+ cut -f 2,3 -d '.' )" \
-- "$cur" ) )
} &&
_screen()
--
1.7.4.4
More information about the Bash-completion-devel
mailing list