Skip to content

feat: add Overlay command for text annotations during recording#716

Closed
domenkozar wants to merge 1 commit into
charmbracelet:mainfrom
domenkozar:feat/overlay-command
Closed

feat: add Overlay command for text annotations during recording#716
domenkozar wants to merge 1 commit into
charmbracelet:mainfrom
domenkozar:feat/overlay-command

Conversation

@domenkozar

@domenkozar domenkozar commented Mar 6, 2026

Copy link
Copy Markdown

Adds a non-blocking Overlay command that draws text on the terminal canvas in the bottom right corner. Supports optional duration (@, default 3s) and customizable background/foreground colors (default white bg, black text).

Syntax: Overlay[@<time>] "<string>" ["<bg>" "<fg>"]

Allows for #164 to be implemented manually

Screenshot from 2026-03-06 07-49-30
  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

Adds a non-blocking Overlay command that draws text on the terminal
canvas in the bottom right corner. Supports optional duration
(@<time>, default 3s) and customizable background/foreground colors
(default white bg, black text).

Syntax: Overlay[@<time>] "<string>" ["<bg>" "<fg>"]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@domenkozar domenkozar requested a review from a team as a code owner March 6, 2026 15:53
@domenkozar domenkozar requested review from andreynering and meowgorithm and removed request for a team March 6, 2026 15:53
@domenkozar domenkozar mentioned this pull request Mar 6, 2026
@echasnovski

Copy link
Copy Markdown

Allows for #164 to be implemented manually

As an outsider, but really curious in the project. Could you share what is the intended way to have it show key presses? Because key press visualization tends to grow and shrink what keys have been typed. Does it mean for Type abc users have to manually Overlay a, Overlay ab, Overlay abc, Overlay bc, Overlay c?

@domenkozar

domenkozar commented Mar 6, 2026

Copy link
Copy Markdown
Author

Allows for #164 to be implemented manually

As an outsider, but really curious in the project. Could you share what is the intended way to have it show key presses? Because key press visualization tends to grow and shrink what keys have been typed. Does it mean for Type abc users have to manually Overlay a, Overlay ab, Overlay abc, Overlay bc, Overlay c?

I wanted to implement overlay feature as something more generic, where overlay can be an explanation of what's happening on the screen.

asciinema implements the overlay as imitating typing and that could be implemented additionally on top of this feature.

You can do things like Overlay@2s "pressing ctrl-r" to just explain what's happening with only this PR.

Note that I think changing of colors of Overlay might be better suited as a global instead of adding that as part of the command (not sure where settings go).

@echasnovski

Copy link
Copy Markdown

You can do things like Overlay@2s "pressing ctrl-r" to just explain what's happening with only this PR.

Sure, and it is valuable. Just not quite what #164 is about.

@domenkozar

Copy link
Copy Markdown
Author

You can do things like Overlay@2s "pressing ctrl-r" to just explain what's happening with only this PR.

Sure, and it is valuable. Just not quite what #164 is about.

I've implemented it to be able to do #164, although I agree this implementation doesn't make it automatic (which I prefer, because some keystrokes I don't want to be shown).

@pkazmier

Copy link
Copy Markdown

I submitted a PR yesterday that adds captioning of keystrokes, which is based on the ASS v4+ subtitle format. When I saw your PR, I knew it would be trivial to overlays using the same technique. While not exactly the same, I expose many more options to be consistent with the same options I exposed for Captioning. You can see a demo of it in PR #719 if interested.

@domenkozar

Copy link
Copy Markdown
Author

Awesome work!

@domenkozar domenkozar closed this Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants