discussion: #14604
Copy keys and result messages on the save screen
The save screen shows a line to paste in the config file, but it has no key to copy the line. Writing the theme to disk was requested in #8145, which probably will not be implemented. A comment in that discussion suggested copying the line to the clipboard, so I did that.
ccopiestheme = <name>.Ccopiesconfig-file = ?auto/theme.ghostty.- The save screen shows the result of
c,Candwnext to the line it applies to. Example:theme = Atom One Light [c] copy ✓ Copied configuration line. #12732 requested this, and I do not see it implemented. Before this change,wgave no result, even when the write failed. - The help screen lists
candCfor the save screen.
Wrapping
per @jcollie's suggestion, I added word wrapping to the save dialog. The new hints and confirmation messages make some lines long. In a narrow terminal, the old code broke words in the middle. It also printed every line at a fixed row, so a wrapped line continued on the row of the next line. If that row was a blank spacer, the text was shown there. If it held text, the next line overwrote the wrapped part. For example, the end of "Or press 'w' to write an auto theme file…" was lost at 58 columns.
- The dialog text now wraps at word boundaries and keeps its left and right margin.
- The dialog is 92 columns wide, as before, and is smaller if the terminal is narrower. It no longer needs to grow to fit the hints.
- The dialog measures the wrapped text first (
printwithcommit = false), so the height fits the text. The newprintWrappedhelper returns the next free row, so lines no longer overwrite each other.
I tested the save screen at 58, 80 and 120 columns, and in a 14-row terminal. At 14 rows the text is cut off but the border stays complete.
Help Dialog
I also added 2 new entries in the help dialog just in case, however this might be redundant because the hint already exists in the save screen.
AI disclosure
I used Claude Code (Sonnet 5.5) to the extent of initial implementation and wording assistance. I reviewed every line, edited the text, built it, and tested it on macOS.
Activity
4ok pushed new changes
A few changes needed.