Commit Graph

18 Commits

Author SHA1 Message Date
Martín Lucas Golini
f200850941 Fix eterm tab closing and macOS menu integration
* Serialize tracked realloc and free bookkeeping to prevent cross-thread
    address reuse from corrupting the memory tracker during tab teardown.
  * Add concurrent allocation and terminal close/resize regression coverage.
  * Install a macOS-only File, Edit, and Window menu that mirrors eterm
    keybindings without binding Cmd+W.
  * Keep the native menu outside the splitter layout and document the canonical
    macOS build workflow.
2026-09-21 21:39:39 -03:00
Martín Lucas Golini
2beab631a2 Implemented the live-indexing fix + Fixed opening and closing the context menu no longer changes the scrollback position.
- Centralized .gitignore, .prjallowed, and .prjdisallowed filtering in src/tools/ecode/projectdirectorytree.cpp:392.
  - Live directories now require an already-admitted parent and use (parentDirectory, filename) matching before insertion.
  - Live file additions use the same shared filtering.
  - Newly admitted directories still load their own nested .gitignore before recursive scanning.
  - Added eight direct regression tests in src/tests/unit_tests/projectdirectorytree_tests.cpp:84.
  - Added the required ecode sources to both Premake unit-test targets.
  - No FileSystemListener changes; directory moves remain outside this Add-focused patch.
  - Context menu issue cause was terminal focus reporting: Codex enables focus events, and opening the popup sent ESC [ O through the ordinary input path, which scrolls to the bottom. Focus reports now use the non-scrolling protocol-write path while still reaching the application correctly.
2026-09-20 14:41:47 -03:00
Martín Lucas Golini
f18ba006fb Fix application cursor keys in terminal sessions
Read application cursor, keypad, and NumLock state from the worker display
when encoding mapped keys. These are display modes rather than terminal text
modes, so checking mTerm.mode caused full-screen applications such as htop
and nvtop to receive normal cursor sequences instead of application-mode
sequences.

Add regression coverage for application-mode Up and Down keys.
2026-09-18 00:26:56 -03:00
Martín Lucas Golini
2edf4cfd43 Fix terminal scroll anFix terminal scroll and selection synchronization
eterm:
    - derive scroll and history notifications from adopted snapshots instead
      of delayed worker events
    - prevent PTY parsing from publishing its temporary live-buffer viewport
    - restore scrollback correctly when new output wraps the history ring
    - keep selections attached to their text during output and absolute scrolling
    - preserve terminal focus and selection while interacting with the scrollbar
    - keep the scrollbar available while a selection is active
    - suppress application mouse reports when Shift overrides mouse capture
    - preserve scrollback when Kitty reports standalone modifier keys
    - retain scroll-to-bottom behavior for regular and modified input keys
    - remove obsolete worker scroll and history event tracking
    - add regression coverage for viewport, selection, focus, keyboard, and
      history behaviord selection synchronization
2026-09-17 20:33:24 -03:00
Martín Lucas Golini
95d52cdbb3 eepp:
- add reusable-buffer String::toUtf8() conversion
  - extract shared find-bar CSS into UIFindBarStyle
  - reuse the shared style from UIDocFindReplace

  ecode:
  - enable terminal find, next, and previous shortcuts
  - install terminal bindings after conflicting editor bindings are removed

  eterm:
  - add searchable terminal history with plain text, RegEx, and LuaPattern modes
  - support case-sensitive and whole-word matching across wrapped rows
  - debounce searches and avoid unnecessary string allocations
  - add an animated find bar with status and wrapped result navigation
  - expose find commands through configurable keybindings and the context menu
  - render and navigate search matches in terminal history
  - forward right-button releases when applications capture the mouse
  - fix UITabWidgetSplitter ownership during shutdown

  tests:
  - cover UTF-8 buffer reuse and terminal search behavior
  - verify wrapped lines, Unicode, pattern modes, invalid expressions, and navigation
  - verify SGR right-button release encoding

  tooling:
  - clarify the mandatory optimized build workflow for performance work
  - require direct release test execution before falling back to Xvfb
2026-09-10 00:57:56 -03:00
Martín Lucas Golini
bd9360cf3e optimize Kitty streaming and complete terminal input
Add persistent Kitty image presentation with RGB24 framebuffer updates,
tile-based damage detection, adaptive zlib compression, chunked Base64
transmission, and unchanged-frame suppression. Fall back to complete updates
when damage exceeds the configured threshold.

Expose environment controls for damage updates, persistent presentation, and
zlib compression level. Resolve presentation policy once during initialization
to keep environment parsing outside the frame path.

Repeat a=f on animation-frame continuation chunks as required by the Kitty
protocol, and suppress graphics acknowledgements from the terminal input
stream.

Complete Kitty keyboard translation for punctuation, function, keypad,
modifier, lock, and navigation keys. Preserve associated multi-codepoint text
and disambiguate Backspace from Delete using their protocol context.

Fix IOStreamMemory::write() to report bytes written so multi-chunk compression
works correctly, avoid stdout logging in the offscreen examples, and add
regression coverage for compressed streams and chunked frame updates.
2026-09-05 17:17:09 -03:00
Martín Lucas Golini
6a24bc0d6e eterm: implement Kitty keyboard protocol
Add Kitty keyboard protocol negotiation, state stacks, and semantic
key encoding with support for alternate keys, event types, associated
text, and reporting all keys as escape sequences.

Forward key press, repeat, and release events through the terminal
worker while preserving legacy input behavior. Keep AltGr composition
distinct from Alt shortcuts and correlate SDL text events to prevent
missing or duplicated international-layout input.

Add protocol documentation and unit coverage for negotiation, state
transitions, modifiers, function and keypad keys, shifted input,
AltGr composition, repeats, releases, and duplicate suppression.
2026-09-04 21:13:27 -03:00
Martín Lucas Golini
0e9f2e832f Optimize eterm Kitty graphics frame replacement
- swap decoded frames into reusable image storage
  - recycle previous frame allocations for subsequent transfers
  - avoid full-frame copies during anonymous image replacement
  - extend tests to verify safe allocation reuse across frames
  - document eterm and eeiv in the project introduction
2026-09-04 18:45:10 -03:00
Martín Lucas Golini
7ed9b7c517 Optimize Kitty graphics decoding and RGB24 rendering
- use fast Base64 decoding for non-final transfer chunks
  - rewrite strict Base64 decoding around complete quartets
  - vectorize Kitty APC control scanning with runtime AVX2 detection
  - preserve RGB24 frames through protocol storage and GPU upload
  - convert RGB24 roots to RGBA only when mutation requires it
  - handle tightly packed RGB texture uploads correctly
  - bridge transient PTY producer gaps to avoid per-chunk idle delays
  - remove the slower POSIX shared-memory transmission path
  - expand Kitty graphics and Base64 regression coverage
  - isolate the Git conflict test from user rerere configuration
2026-09-04 18:12:26 -03:00
Martín Lucas Golini
090e7c1288 Compilation fixes. 2026-09-03 20:29:57 -03:00
Martín Lucas Golini
e45ff6af00 eterm: reuse Kitty graphics transfer buffers
Reduce allocation pressure in the Kitty graphics receive path by caching and
reusing decoded, pixel-conversion, encoded-image, and frame-composition
buffers.

Reuse uniquely owned pixel storage when replacing an existing image while
preserving immutable update data still referenced by the renderer.

Add runtime SSSE3 capability detection to CPU for future optimized paths and
extend Kitty graphics tests to cover buffer reuse and strict Base64 decoding
across boundary and large payload sizes.
2026-09-03 20:18:30 -03:00
Martín Lucas Golini
0fa1f65d04 Optimize eterm Kitty graphics rendering
- bulk-ingest Kitty APC payloads without per-byte UTF-8 processing
  - preserve APC buffer capacity between graphics commands
  - update existing GPU textures when replacing video frames
  - validate Base64 while decoding directly into transfer storage
  - reserve known image sizes and share immutable pixel buffers
  - coalesce superseded anonymous video-frame updates
  - support POSIX shared-memory transmission with stable snapshots
  - fix large unchunked images and anonymous placement replacement
  - add fragmentation, malformed input, video, and shared-memory tests
  - update Kitty graphics protocol documentation
2026-09-03 19:39:47 -03:00
Martín Lucas Golini
57754feb31 Added Kitty Graphics Protocol support for eterm module, still a WIP but working. 2026-09-03 17:19:27 -03:00
Martín Lucas Golini
c5c6350920 eterm: harden threaded presentation and terminal protocol handling
- preserve CSI subparameter separators for modern SGR color sequences
  - fix synchronized updates and periodic presentation under sustained output
  - support OSC palette queries, resets, and color scheme notifications
  - implement alternate scroll, cursor style, and terminal version queries
  - preserve the configured cursor shape for default blinking cursor requests
  - recognize Kitty keyboard negotiation without falsely advertising support
  - recognize OSC 8 hyperlink markers without emitting parser errors
  - make release parser diagnostics opt-in through ETERM_LOG_ERRORS
  - update the Kitty keyboard protocol implementation plan for worker ownership
  - add regression coverage for rendering, colors, CSI modes, cursors, and OSC 8
2026-08-31 03:01:40 -03:00
Martín Lucas Golini
bfa9b6ab60 Rename TerminalController to TerminalSession. 2026-08-31 01:15:28 -03:00
Martín Lucas Golini
8bcec85da0 Move eterm emulation off the UI thread and add tabbed frontend
- introduce a per-terminal worker controller with ordered command queues,
    coalesced events, immutable snapshots, and deterministic shutdown
  - move PTY reads, parsing, history, selection, resize, reflow, and process
    status handling onto the terminal worker
  - publish terminal snapshots at the host refresh rate while preserving
    immediate idle, resize, interaction, and final-exit presentation
  - migrate TerminalDisplay, UITerminal, eterm, ecode, debugger, and ACP
    integrations away from direct mutable emulator access
  - synchronize scrollbar updates with acknowledged scroll commands
  - preserve title, clipboard, bell, prompt, color, restart, keep-alive,
    selection, input, and buffered process-exit behavior
  - add bounded synchronous selection requests and idempotent worker shutdown
  - make POSIX process launch safe after fork in multithreaded hosts and mark
    original PTY descriptors close-on-exec
  - add an UIApplication-based tabbed eterm with legacy CLI parity, tab
    lifecycle handling, close warnings, and default navigation shortcuts
  - add premake targets and deterministic controller, snapshot, lifecycle,
    concurrency, presentation, and exit-drain tests
2026-08-30 20:25:44 -03:00
Martín Lucas Golini
7ffcccb9cb eterm: optimize terminal output processing
* Add fast paths for printable ASCII, row clearing, scrolling, history recycling, dirty tracking, and history width detection.
* Use runtime-dispatched AVX2 and NEON scanning for trailing blank cells, increase the PTY read buffer, and bound PTY processing and presentation to keep sustained output responsive.
* Preserve selection redraws, wide glyph cleanup, VT100 graphics handling, history reflow, and final buffered PTY output after process exit.
* Add regression coverage for deferred redraws, saturated reads, process termination, history scrolling, wide glyphs, and graphics character sets.
2026-08-22 20:28:45 -03:00
Martín Lucas Golini
7150633c1a Fixes in URI implementation to handle some special cases, added some tests too.
Fix flaky test.
Renamed tests to have consistent naming.
2026-05-03 02:22:37 -03:00