fortrangoingonforty/fortsh / fa0c02f

Browse files

document text selection + clipboard in README

Authored by espadonne
SHA
fa0c02f2d3eb829992be001f4b234623dad8b671
Parents
f202d06
Tree
d2c32c1

1 changed file

StatusFile+-
M README.md 25 0
README.mdmodified
@@ -46,6 +46,7 @@ Pretty much everything:
4646
 - History with Ctrl+R and autosuggestions
4747
 - Tab completion for commands, paths, and variables
4848
 - Syntax highlighting as you type
49
+- Native text selection with Shift+Arrow + system clipboard (pbcopy / xclip / wl-copy / xsel)
4950
 - Arrays (indexed and associative)
5051
 - Full parameter expansion (`${var#pattern}`, `${var//find/replace}`, `${var^^}`, etc.)
5152
 - Process substitution (`<(cmd)`, `>(cmd)`)
@@ -58,6 +59,7 @@ Pretty much everything:
5859
 - Vi and Emacs editing modes
5960
 - Per-builtin help texts (`help cd`, `help export`, etc.)
6061
 - fzf integration (file browser, history search, directory jump, git browser)
62
+- Bracketed paste mode (large pastes land atomically)
6163
 
6264
 ## What Doesn't Work
6365
 
@@ -153,6 +155,29 @@ Works with Tab completion. Valid directories highlight green.
153155
 | Ctrl-H | Search history |
154156
 | Alt-G | Search git files |
155157
 
158
+**Text selection** (live since v1.7.0 — works like a GUI editor in the terminal):
159
+
160
+| Key | Action |
161
+|-----|--------|
162
+| Shift+Left / Shift+Right | Extend selection by character |
163
+| Shift+Home / Shift+End | Extend selection to line start / end |
164
+| Shift+Up / Shift+Down | Extend selection line-wise (Home / End on single-line prompt) |
165
+| Ctrl+Shift+Left / Ctrl+Shift+Right | Extend selection by word |
166
+| Alt+Shift+B / Alt+Shift+F | Extend selection by word (emacs-native alias) |
167
+| any plain motion (Left, Home, Alt+b, ...) | Collapse selection — char-motions snap to the appropriate edge |
168
+| Ctrl+W or Ctrl+X | Cut selection (writes to kill buffer + system clipboard) |
169
+| Alt+W | Copy selection (kill buffer + system clipboard, no delete) |
170
+| Ctrl+Y | Paste from kill buffer (deletes selection first if active) |
171
+| Ctrl+V | Paste from system clipboard (falls back to kill buffer if no tool) |
172
+| typing a printable char | Replaces the selection in place (type-over) |
173
+| Backspace / Delete | Removes the entire selection |
174
+
175
+System clipboard bridge auto-detects `pbcopy` (macOS), `wl-copy` (Wayland), `xclip` or `xsel` (X11) at startup. If none are installed, cut/copy still work via the in-session kill buffer.
176
+
177
+Env flags:
178
+- `FORTSH_DEBUG_SELECTION=1` — dump selection state to stderr on each mutation
179
+- `FORTSH_NO_BRACKETED_PASTE=1` — disable `ESC[?2004h` emit (terminal-compat triage)
180
+
156181
 ### Tab Completion
157182
 
158183
 Works for commands, paths, variables, and command-specific options.