Skip to content

Commit 9cde25b

Browse files
jerkeyscop
authored andcommitted
screen: complete first arg with serial devices
Modified-by: Ville Skyttä <ville.skytta@iki.fi>
1 parent 188ca8a commit 9cde25b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

completions/screen

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ _screen()
2525
local cur prev words cword
2626
_init_completion || return
2727

28+
if [[ $cword -eq 1 && $cur == /dev* ]]; then
29+
COMPREPLY=( $(compgen -W "$(shopt -s nullglob; printf '%s\n' \
30+
/dev/serial/by-id/* /dev/ttyUSB* /dev/ttyACM* 2>/dev/null)" \
31+
-- "$cur") )
32+
return
33+
fi
34+
2835
if ((cword > 2)); then
2936
case ${words[cword-2]} in
3037
-*[dD])

0 commit comments

Comments
 (0)