about summary refs log tree commit diff
path: root/Completion/Unix/Command/_screen
blob: d8c70cb1654f648be10edf933e3d21c27d2dd620 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#compdef screen 
#Generated by Felix Rosencrantz

 local context state line scr_cmds
 scr_cmds=(
  acladd	aclchg		acldel		aclgrp		aclumask
  activity	addacl		allpartial	at		attrcolor
  autodetach	autonuke	backtick	bce		bell_msg
  bind		bindkey		break		breaktype	bufferfile
  c1		caption		charset		chdir		clear
  colon		command		compacthist	console		copy
  copy_reg	crlf		debug		defautonuke	defbce
  defbreaktype	defc1		defcharset	defencoding	defescape
  defflow	defgr		defhstatus	defkanji	deflog
  deflogin	defmode		defmonitor	defobuflimit	defscrollback
  defshell	defsilence	defslowpaste	defutf8		defwrap
  defwritelock	defzombie	detach		digraph		dinfo
  displays	dumptermcap	echo		encoding	escape
  eval		exec		fit		flow		focus
  gr		hardcopy	hardcopy_append	hardcopydir	hardstatus
  height	help		history		hstatus		ignorecase
  info		ins_reg		kill		lastmsg		license
  lockscreen	log		logfile		login		logtstamp
  mapdefault	mapnotnext	maptimeout	markkeys	maxwin
  meta		monitor		msgminwait	msgwait		multiuser
  nethack	next		nonblock	number		obuflimit
  only		other		partial		password	paste
  pastefont	pow_break	pow_detach	pow_detach_msg	prev
  printcmd	process		quit		readbuf		readreg
  redisplay	register	remove		removebuf	reset
  resize	screen		scrollback	select		sessionname
  setenv	setsid		shell		shelltitle	silence
  silencewait	sleep		slowpaste	sorendition	source
  split		startup_message	stuff		su		term
  termcap	termcapinfo	terminfo	time		title
  unsetenv	utf8		vbell		vbell_msg	vbellwait
  verbose	version		wall		width		windowlist
  windows	wrap		writebuf	writelock	xoff
  xon		zombie
 )
  
  typeset -A opt_args
  _arguments \
	"-a[Force all capabilities into each window's termcap.]" \
	'-A:Adapt all windows to the new display width & height.' \
	"-c:Read configuration file instead of '.screenrc'.:_files -/" \
	'-d:Detach the elsewhere running screen (with -r: reattach here).:->sessionname' \
	'-dmS:Start as daemon: Screen session in detached mode.' \
	'-D:Detach and logout remote (with -r: reattach here).' \
	'-e:Change command characters.' \
	'-f-:Flow control on, -fn = off, -fa = auto.:((n\:Flow\ conrol\ off a\:Flow\ conrol\ auto))' \
	'-h:Set the size of the scrollback history buffer.' \
	'-i[Interrupt output sooner when flow control is on.]' \
	'-l[Login mode on (update /var/run/utmp), -ln = off.]' \
	'-list[Do nothing, just list our SockDir.]' \
	'-ls[Do nothing, just list our SockDir.]' \
	"-L[Terminal's last character can be safely updated.]" \
	'-m[ignore $STY variable, do create a new screen session.]' \
	'-O[Choose optimal output rather than exact vt100 emulation.]' \
	'-p:Preselect the named window if it exists.' \
	'-q[Quiet startup. Exits with non-zero return code if unsuccessful.]' \
	'-r[Reattach to a detached screen process.]:Handling Tag sessionname:->sessionname' \
	'-R[Reattach if possible, otherwise start a new session.]' \
	'-s:Shell to execute rather than $SHELL.' \
	'-S:Name this session <pid>.sockname instead of <pid>.<tty>.<host>.' \
	"-t:Set title. (window's name)." \
	'-T:Use term as $TERM for windows, rather than "screen".' \
	'-U[Tell screen to use UTF-8 encoding.]' \
	'-v[Print screen version.]' \
	'-wipe[Do nothing, just clean up SockDir.]' \
	'-x[Attach to a not detached screen. (Multi display mode).]' \
	'-X[Execute <cmd> as a screen command in the specified session.]:screencmd:(${scr_cmds[@]})'

case $state in
  "sessionname")
  # Complete folder names.
  local screendir

    screendir=(`screen -ls | grep Socket | sed -n -e 's/\.$//' -e '$p' | awk '{print $NF;}'`)

  _wanted files expl 'screen process' _path_files -W screendir
;;
esac