- Add serializable state structs (WorkspaceState, TabState, PaneState, etc.)
- Implement Workspace::save() to persist open tabs, cursor positions,
viewport scroll, and pane bounds to .fackr/workspace.json
- Implement Workspace::load() to restore workspace state on startup,
handling missing files gracefully
- Add Cursors::from_cursor() constructor for state restoration
- Call workspace.save() on editor exit
- Replace empty default tab when opening explicit file to avoid
spurious [new] tab appearing as tab 1
Add active window focus system where keyboard input is routed to the
last-activated component instead of using fixed priority.
Changes:
- Add Focus enum (Editor, Terminal, FussMode, ServerManager, Prompt)
- Add HitRegion enum for mouse hit testing
- Add focus field to Editor struct
- Implement hit_test() to determine clicked region
- Implement return_focus() helper for closing components
- Add click-to-focus in mouse handler
- Update toggle handlers to set focus when opening/closing
- Refactor keyboard routing from priority-based to focus-based
Behavior:
- Clicking any component gives it keyboard focus
- Keyboard shortcuts that open components also focus them
- Clicking in split panes makes that pane active
- ESC closes focused component and returns focus sensibly
Add methods to determine which pane contains a screen coordinate:
- Tab::pane_at_screen_position() - finds pane by normalized coordinates
- Workspace::pane_at_position() - wrapper for active tab
When both fuss mode and terminal are visible, fuss mode now only renders
above the terminal instead of using full screen height. This prevents
visual artifacts where fuss mode content would render into the terminal
area.
- Add max_rows parameter to render_fuss
- Calculate available height based on terminal start row
- F3/Ctrl+B now toggles fuss mode even when terminal is focused
- Terminal shrinks to fit alongside fuss mode instead of overlapping
- Pass left_offset to render_terminal for proper positioning
Fuss mode (file tree) should be accessible even when terminal is active.
Add pass-through for F3 and Ctrl+B keybindings so they toggle fuss mode
instead of being sent to the terminal.
Add keybindings for terminal tab management (when terminal focused):
- Alt+T: Create new terminal tab
- Alt+Q: Close current tab (hides terminal if last)
- Alt+.: Next tab
- Alt+,: Previous tab
- Alt+1-9: Switch to specific tab
Update terminal title bar to show tabs when multiple sessions exist:
- Single session: show CWD or "Terminal" centered with separators
- Multiple sessions: tab bar with numbers and directory names
- Active tab highlighted with bold white on darker background
- Add extract_dirname() helper for path display
Add CWD tracking to TerminalScreen:
- Add cwd field to store current working directory
- Implement osc_dispatch to parse OSC 7 sequences
- Extract path from file://hostname/path format
- Fish shell emits OSC 7 automatically on directory change
Refactor TerminalPanel to support multiple terminal sessions:
- Add TerminalSession struct holding PTY + screen buffer per session
- Change from single PTY to Vec<TerminalSession> with active index
- Add session management methods: new_session(), close_active_session(),
switch_session(), next_session(), prev_session()
- Poll all sessions to keep background shells responsive
- Auto-remove dead sessions and hide terminal when last closes
Instead of sending color/attribute escape sequences for every cell,
track current state and only send changes. Batch consecutive characters
with same attributes into single print operations. This dramatically
reduces the number of escape sequences sent per render.
Detect when the shell process exits (via EOF or error on PTY read)
and automatically hide the terminal panel. Typing 'exit' now cleanly
closes the integrated terminal instead of leaving it in a broken state.
- Fix flashing: poll() now returns bool, only render when data received
- Add DEC private modes: ?1/?7/?25/?1049/?2004 (cursor keys, autowrap,
cursor visibility, alternate screen, bracketed paste)
- Implement alternate screen buffer for vim/less compatibility
- Add missing CSI commands: E/F/G/L/M/P/S/T/X/@/d/n/r/s/u
- Complete J=1 and K=1 (clear from start to cursor)
- Add scroll region support (DECSTBM)
- Handle escape sequences: ESC 7/8/M/D/E/c (cursor save/restore,
index, reverse index, next line, reset)
- Add device status report responses (CSI 5n, CSI 6n)
This should fix fish shell's two-line prompt and vim rendering.