Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Fix cu completion for OSX



Hi,
I use cu for Arduino stuff and habitually type cu -l /dev/cu.<tab> and get annoyed it doesn't match anything.
OSX has ttys named cu.* and tty.* and uses Taylor CU.

This patch works for me (tm).

--- _cu.orig	2018-11-17 11:54:18.000000000 +1030
+++ _cu	2018-11-17 12:07:43.000000000 +1030
@@ -32,7 +32,7 @@
       '(-E --escape)'{-E+,--escape=}'[specify escape character]:escape character [~]'
       '(-a -p --port)'{-a+,-p+,--port=}'[specify the port]:port'
       '(-c --phone -n --prompt)'{-c+,--phone=}'[specify phone number to call]:phone number'
-      '(1 -l -z --system)--line=[specify line to use]:line:(/dev/(cuaU#<->|ttyS<->|tty.*)(N%c))'
+      '(1 -l -z --system)--line=[specify line to use]:line:(/dev/(cuaU#<->|ttyS<->|tty.*|cu.*)(N%c))'
     )
   ;|
   taylor)
@@ -63,5 +63,5 @@

 _arguments -s $args \
   '(--speed)-s+[set line speed for the connection]:line speed [9600]:_baudrates' \
-  '(1 --line -z --system)-l+[specify line to use]:line:(/dev/(cuaU#<->|ttyS<->|tty.*)(N%c))' \
+  '(1 --line -z --system)-l+[specify line to use]:line:(/dev/(cuaU#<->|ttyS<->|tty.*|cu.*)(N%c))' \
   '1: :_guard "^-*" system'

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum




Messages sorted by: Reverse Date, Date, Thread, Author