@@ -46,6 +46,7 @@ Pretty much everything: |
| 46 | 46 | - History with Ctrl+R and autosuggestions |
| 47 | 47 | - Tab completion for commands, paths, and variables |
| 48 | 48 | - Syntax highlighting as you type |
| 49 | +- Native text selection with Shift+Arrow + system clipboard (pbcopy / xclip / wl-copy / xsel) |
| 49 | 50 | - Arrays (indexed and associative) |
| 50 | 51 | - Full parameter expansion (`${var#pattern}`, `${var//find/replace}`, `${var^^}`, etc.) |
| 51 | 52 | - Process substitution (`<(cmd)`, `>(cmd)`) |
@@ -58,6 +59,7 @@ Pretty much everything: |
| 58 | 59 | - Vi and Emacs editing modes |
| 59 | 60 | - Per-builtin help texts (`help cd`, `help export`, etc.) |
| 60 | 61 | - fzf integration (file browser, history search, directory jump, git browser) |
| 62 | +- Bracketed paste mode (large pastes land atomically) |
| 61 | 63 | |
| 62 | 64 | ## What Doesn't Work |
| 63 | 65 | |
@@ -153,6 +155,29 @@ Works with Tab completion. Valid directories highlight green. |
| 153 | 155 | | Ctrl-H | Search history | |
| 154 | 156 | | Alt-G | Search git files | |
| 155 | 157 | |
| 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 | + |
| 156 | 181 | ### Tab Completion |
| 157 | 182 | |
| 158 | 183 | Works for commands, paths, variables, and command-specific options. |