Skip to content

Commit

Permalink
hint about ^- vs ^? depending on terminal emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
mitranim committed Jun 23, 2021
1 parent 25e28fe commit 76f9356
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
24 changes: 12 additions & 12 deletions gow.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,28 @@ Examples:
Options:
-v Verbose logging
-c Clear terminal
-s Soft-clear terminal, keeping scrollback
-e Extensions to watch, comma-separated; default: %[1]q
-i Ignored paths, relative to CWD, comma-separated
-g The Go tool to use; default: %[2]q
-v Verbose logging
-c Clear terminal
-s Soft-clear terminal, keeping scrollback
-e Extensions to watch, comma-separated; default: %[1]q
-i Ignored paths, relative to CWD, comma-separated
-g The Go tool to use; default: %[2]q
Supported control codes / hotkeys:
3 ^C kill subprocess or self with SIGINT
18 ^R kill subprocess with SIGTERM, restart
20 ^T kill subprocess with SIGTERM
28 ^\ kill subprocess or self with SIGQUIT
31 ^? print the currently running command
3 ^C kill subprocess or self with SIGINT
18 ^R kill subprocess with SIGTERM, restart
20 ^T kill subprocess with SIGTERM
28 ^\ kill subprocess or self with SIGQUIT
31 ^- or ^? print the currently running command
`, EXTENSIONS, *FLAG_CMD)

const (
ASCII_END_OF_TEXT = 3 // ^C
ASCII_FILE_SEPARATOR = 28 // ^\
ASCII_DEVICE_CONTROL_2 = 18 // ^R
ASCII_DEVICE_CONTROL_4 = 20 // ^T
ASCII_UNIT_SEPARATOR = 31 // ^?
ASCII_UNIT_SEPARATOR = 31 // ^- or ^?

CODE_INTERRUPT = ASCII_END_OF_TEXT
CODE_QUIT = ASCII_FILE_SEPARATOR
Expand Down
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ gow -h

## Hotkeys

Supported control codes with commonly associated hotkeys:
Supported control codes with commonly associated hotkeys. Exact keys may vary between terminal apps. For example, `^-` in MacOS Terminal vs `^?` in iTerm2.

```
3 ^C kill subprocess or self with SIGINT
18 ^R kill subprocess with SIGTERM, restart
20 ^T kill subprocess with SIGTERM
28 ^\ kill subprocess or self with SIGQUIT
31 ^? print the currently running command
3 ^C kill subprocess or self with SIGINT
18 ^R kill subprocess with SIGTERM, restart
20 ^T kill subprocess with SIGTERM
28 ^\ kill subprocess or self with SIGQUIT
31 ^- or ^? print the currently running command
```

Other input is forwarded to the subprocess as-is.
Expand Down

0 comments on commit 76f9356

Please sign in to comment.