Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit OSC 0 escape sequence when executing another command #496

Open
WhyNotHugo opened this issue Jan 21, 2025 · 0 comments
Open

Emit OSC 0 escape sequence when executing another command #496

WhyNotHugo opened this issue Jan 21, 2025 · 0 comments

Comments

@WhyNotHugo
Copy link
Contributor

WhyNotHugo commented Jan 21, 2025

The OSC-0 escape sequence updates a terminal's title bar to a given string.

I have the following in my .zshrc:

preexec () {
  print -Pn "\e]0;$1 [%~]\a"
}

When I execute any command (e.g.: neovim hello.txt), this emits an escape sequence that updates the terminal title-bar to neovim hello.txt.

When I run zk edit --interactive, my terminal's title-bar is updated to zk edit --interactive. When I select an entry in zk, zk executes neovim, but my terminal's title-bar remains the same.

This is a feature request for zk to emit an OSC-0 escape sequence before exec'ing into another command, so that the terminal title is updated to the executed command.

As an optional cherry on top, the title of the note could be appended, so instead of neovim kdux.md, the title-bar reads neovim kdux.md [title of note].

Context

When I have multiple windows with multiple notes open, the titles for all these is simply zk e (e is my alias for edit --interactive ….

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

No branches or pull requests

1 participant