You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an embedded Terminal tool window, like JetBrains' terminal: a
bottom-docked panel running a real interactive shell rooted at the current workspace folder, so the writer can run git, scripts, file ops etc.
without leaving Rhymr.
Motivation
Rhymr is aiming to be a "JetBrains-capable IDE" for lyrics; an integrated
terminal is table stakes for that workflow. It also complements the VCS
work (gutter, branch status, Git Log #3) — quick git / shell access in the
project context.
Toggled from the bottom stripe + an app.terminal gio action/accel
(JetBrains uses Alt+F12) + a menu entry.
CWD = workspace root. Uses the shared root path from WorkspaceController; when there's no open project, falls back to the
user's home dir. Opening / switching projects starts (or offers to
restart) the shell in the new root — mirror how the status-bar branch
segment and file tree react to a root change.
Real interactive PTY: full-screen curses apps (vim, htop, git log
pager), colour, resize/SIGWINCH, Ctrl-C etc. all work.
Multiple terminal tabs within the panel, each independently
rooted at the workspace; a "+" to open another, close on tab close or
shell exit.
Shell selection: Settings override, else $SHELL on macOS / %ComSpec%
(or PowerShell) on Windows.
Copy/paste, select, scrollback, clear; font = the editor monospace
(--app-font-* from Settings); 16-colour + default fg/bg from the src/css.rsPALETTE (dark/light), matched to the editor scheme.
PTY read/write loop runs off the GTK main thread; output marshalled
to the widget on the main loop (CLAUDE.md non-negotiable).
CLAUDE.md requires macOS + Windows parity and a shared platform trait,
not copy-paste. The terminal core is the crux:
Option A — VTE4 (vte4 crate / libvte-2.91-gtk4): drop-in GTK4
terminal widget, least code. But VTE is GNOME/Linux-first — awkward to
ship on macOS (Homebrew libvte) and not available on Windows. Fails
the parity requirement on its own.
Option B — portable PTY + emulator core + custom render (recommended
for parity): portable-pty (wezterm) for the cross-platform PTY
(ConPTY on Windows, openpty on Unix), an emulation core
(alacritty_terminal, or the vte parser crate feeding our own grid),
rendered into a gtk::DrawingArea with the Settings monospace font and
palette colours. More work, but one code path on both OSes with only the
PTY spawn behind the platform trait.
Option C — hybrid: VTE4 where present, Option B elsewhere. Two
renderers to maintain — least attractive.
Recommend Option B. Confirm approach before starting (this touches the
platform trait — per CLAUDE.md "when unsure, ask").
Proposed structure
app/terminal.rs — the panel widget: tab bar + terminal view(s), ToolWindow registration, toggle plumbing.
Summary
Add an embedded Terminal tool window, like JetBrains' terminal: a
bottom-docked panel running a real interactive shell rooted at the current
workspace folder, so the writer can run git, scripts, file ops etc.
without leaving Rhymr.
Motivation
Rhymr is aiming to be a "JetBrains-capable IDE" for lyrics; an integrated
terminal is table stakes for that workflow. It also complements the VCS
work (gutter, branch status, Git Log #3) — quick
git/ shell access in theproject context.
Behaviour (target)
registers as a
ToolWindowin the dock manager (Rearrangeable tool-window layout: dock/move/resize/float like a JetBrains IDE #4) so it can betoggled, resized, moved and (eventually) floated.
app.terminalgio action/accel(JetBrains uses Alt+F12) + a menu entry.
WorkspaceController; when there's no open project, falls back to theuser's home dir. Opening / switching projects starts (or offers to
restart) the shell in the new root — mirror how the status-bar branch
segment and file tree react to a root change.
git logpager), colour, resize/
SIGWINCH, Ctrl-C etc. all work.rooted at the workspace; a "+" to open another, close on tab close or
shell exit.
Settingsoverride, else$SHELLon macOS /%ComSpec%(or PowerShell) on Windows.
(
--app-font-*from Settings); 16-colour + default fg/bg from thesrc/css.rsPALETTE(dark/light), matched to the editor scheme.to the widget on the main loop (CLAUDE.md non-negotiable).
Key design question — terminal widget / cross-platform parity
CLAUDE.md requires macOS + Windows parity and a shared
platformtrait,not copy-paste. The terminal core is the crux:
vte4crate /libvte-2.91-gtk4): drop-in GTK4terminal widget, least code. But VTE is GNOME/Linux-first — awkward to
ship on macOS (Homebrew libvte) and not available on Windows. Fails
the parity requirement on its own.
for parity):
portable-pty(wezterm) for the cross-platform PTY(ConPTY on Windows,
openptyon Unix), an emulation core(
alacritty_terminal, or thevteparser crate feeding our own grid),rendered into a
gtk::DrawingAreawith the Settings monospace font andpalette colours. More work, but one code path on both OSes with only the
PTY spawn behind the platform trait.
renderers to maintain — least attractive.
Recommend Option B. Confirm approach before starting (this touches the
platform trait — per CLAUDE.md "when unsure, ask").
Proposed structure
app/terminal.rs— the panel widget: tab bar + terminal view(s),ToolWindowregistration, toggle plumbing.terminal/module — OS-agnostic: PTY session lifecycle, the emulatorgrid/parser, input encoding, resize.
platform/*— only the PTY spawn (shell path, env, ConPTY vs openpty)behind the existing platform trait; no duplicated session logic.
in the one constants/config module, not scattered.
CSS_FILESinsrc/css.rsandbuild.rs; boxy,--radius-* = 0. Icons viacrate::app::icons::img.layout.*settings area from Rearrangeable tool-window layout: dock/move/resize/float like a JetBrains IDE #4.
Phasing
colour/resize/scrollback, copy-paste, off-thread IO. Depends on the
widget decision above.
clear action.
in scrollback, "open terminal here" from a file-tree folder context
menu.
Out of scope
Acceptance criteria
toggled from the stripe +
app.terminalaction/accel + menu entry.project); full-screen TUI apps, colour and resize work.
session/emulation logic is shared, not duplicated.
OS default.
src/css.rspalette in both themes.
css.rs+build.rs; icons viaicons::img.cargo fmt+cargo clippyclean; syllable regression suiteunaffected.