prompt
[command...]
prompt
sits between your terminal and your shell session and notices when you are being prompted to enter a line. Instead of the kernel canonical terminal mode, you edit the line with newline(1).
No options may be specified, executes command.
The line editing program may be overridden by placing a custom newline
early in your PATH.
Lots. This is pre-release software.
Public Domain
newline(1)
newline
[options] [n]
newline
interactively edits n lines (one at a time) and copies them stdout. It supports Unicode (including characters beyond the BMP and combining characters), history, kill and yank, and unambiguous display of inline control characters.
The number of lines to copy, n, must come last. It defaults to 1 and may be inf to copy an arbitrary number of lines.
-
--pty
Output a stream suitable for feeding to a pty master. (Don't act onC-d
orC-c
.) -
--history _filename_
Load and save history from filename instead of~/.newline_history
.
Below, C-x
indicates Control-x, likewise M-x
for Alt-x (Or more precisely, ESC x
).
- Move backward one character.
C-b
,Left
- Move forward one character.
C-f
,Right
- Move backward one word.
M-b
,C-Left
- Move forward one word.
M-f
,C-Right
- Move backward the whole line.
C-a
,Home
- Move forward the whole line.
C-e
,End
Delete and Kill both remove characters from the line, however characters removed with a Kill can be returned in a different place with a Yank. Multiple Kills in a row will accumulate and may be Yanked all together.
- Delete backward one character.
Backspace
- Delete forward one character.
Delete
- Kill backward one character.
C-h
- Kill backward one word.
C-w
- Kill backward the whole line.
C-u
- Kill forward the whole line.
C-k
- Yank, insert previously killed text.
C-y
- Send with Newline.
C-m
,Enter
- Send with End of Text.
C-d
- Send empty line with interrupt.
C-c
- Previous line in history.
C-p
,Up
- Next line in history.
C-n
,Down
- Undo all changes to this line.
C-z
- Enable line echo:
C-q
- Disable line echo:
C-S
- Insert literal character:
C-v
newline
makes a number of assumptions:
- All input and output is UTF-8.
- Terminals understand
ESC [ Ps C
: Move cursor forwardPs
times. - Terminals understand
ESC [ Ps D
: Move cursor backwardPs
times. - Terminals understand
ESC [ 0 K
: Erase everything to the right of cursor. - Terminals understand or ignore
ESC [ Pm (; Pm)* m
: Set character attributes (color, intensity, and normal).
Public Domain
prompt(1), readline(3), editline(3), linenoise