Commit Graph
15 Commits
Author SHA1 Message Date
Salvatore Sanfilippo d12898f4e2 Initialize the terminal escape buffer for GCC dataflow checks
Make the empty escape buffer explicit without changing incremental key handling. This removes the maybe-uninitialized warning found by the DGX Spark QA build.
2026-09-06 23:41:41 +02:00
Salvatore Sanfilippo db1942148c Fix agent terminal redraws, Unicode input and Markdown rendering
Buffer complete terminal updates, repaint status without erasing live input, and retain pending redraws across throttling. Preserve fragmented UTF-8, navigation and paste input, and bound tab completion safely.

Use shared Unicode width handling for input, output and queued prompts. Preserve unmatched Markdown delimiters and publish code recoloring as one update. Add focused terminal regression tests.
2026-09-06 22:50:20 +02:00
antirez 9f6af8857e Polish agent raw mode restoration 2026-06-09 13:12:41 +02:00
fry69 61886b452e fix: restore terminal state correctly on quit and help
Three fixes for regressions introduced by the raw-mode restoration
commit (ce5b70b):

1. agent_prompt_yes_no_ex: handle non-blocking stdin
   editor_start sets O_NONBLOCK on stdin; fgets() returned NULL
   immediately (EAGAIN) causing the save prompt to exit without
   waiting for user input.  Temporarily switch to blocking mode
   around the fgets call.

2. /quit handler: stop editor before prompting
   editor_restore_terminal_layout resets the scroll region but does
   not disable raw mode or restore stdin flags.  Call editor_stop
   first so that raw mode is off and stdin is blocking when we
   prompt the user.  Handle AGENT_EXIT_CANCEL by restarting the
   editor instead of leaving it half-stopped.

3. linenoiseRestoreRawMode: do not corrupt orig_termios
   The function unconditionally overwrote orig_termios with the
   current terminal attributes via tcgetattr.  While the editor is
   active those are the raw-mode settings (OPOST cleared).  Later,
   disableRawMode restores this corrupted orig_termios, leaving the
   terminal in raw mode after editor_stop.  puts output then lacks
   carriage returns, causing garbled display (e.g. /help).
   Only update orig_termios when rawmode == 0 (child process
   changed terminal to cooked).
2026-06-09 05:02:32 +02:00
fry69 ce5b70be9c fix(agent): restore raw mode 2026-06-09 03:43:37 +02:00
antirez 7cea3333e0 Fix compiler warnings in agent and TUI code 2026-05-23 12:58:56 +02:00
antirez a365e4463d Fix agent status bar glyph width 2026-05-20 23:39:19 +02:00
antirez 799dff48a7 Keep ds4-agent prompt visible during streamed output 2026-05-20 20:51:24 +02:00
antirez d3b69bea25 Make linenoise history folding less aggressive 2026-05-20 17:45:40 +02:00
antirez 23cf510031 Improve ds4-agent TUI and history replay 2026-05-20 16:37:02 +02:00
antirez b12e5f7045 Fix agent tool and Ctrl-C prompt rendering 2026-05-20 08:30:07 +02:00
antirez 1aedee468d Fix ds4-agent adaptive terminal layout
Use an ANSI scroll region for streamed agent output, resize it as linenoise input wraps or shrinks, and anchor the prompt/status block at the terminal bottom. This also fixes cursor placement at exact column boundaries and removes the prompt/output overwrite cases seen during multiline editing.
2026-05-20 08:21:40 +02:00
antirez 599e49d253 Add native DS4 agent
Add ds4-agent as a native terminal coding agent with session KV storage, DSML tool execution, edit/read/search/write/list/bash tools, async bash jobs, compaction support, history replay, and a linenoise-based interactive UI.

The agent defaults to CRC-guarded edits, streams tool visualization, ignores tool calls emitted inside thinking, improves bash output observations for long-running commands, and styles prompts, spacing, and prefill progress for interactive use.
2026-05-19 22:40:07 +02:00
matteo baccan a0510c2ac2 Fix typos in comments for clarity in linenoise.c and linenoise.h 2026-05-07 18:57:58 +02:00
antirez d997b56c15 DS4 initial release 2026-05-07 17:16:28 +02:00