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

Setting title doesn't work in terminals launched via 'msg create-window' when instance was created with --title #6836

Closed
hiredman opened this issue Apr 4, 2023 · 9 comments · Fixed by #7927

Comments

@hiredman
Copy link

hiredman commented Apr 4, 2023

Hello,

When I launch a terminal with "alacritty" that terminal's title is updated with the running command / pwd as I do stuff in it. When I launch` a terminal with "alacritty msg create-window" the title isn't being updated, it just stays as "Alacritty"

the zsh snippet responsible for updating the terminals title is:

case $TERM in
    xterm*|alacritty)
        preexec () {
	    print -Pn "\e]0;$1\a"
	}
	precmd () {
	    print -Pn "\e]0;$PWD\a"
	}
        ;;
esac

System

OS: Fedora Linux 39 (Rawhide Prerelease)
Version: alacritty 0.10.1
Linux/BSD: X11 i3wm

@kchibisov
Copy link
Member

Maybe your snippet is not being red in this case?

I'd assume that if you manually request to set title with one of those escapes it'll work just fine.

@hiredman
Copy link
Author

hiredman commented Apr 4, 2023

if I run print -Pn "\e]0;FOO\a" in the shell (zsh) the title of the alacritty terminal window remains "Alacritty"

so no, it doesn't work just fine in that case either

@kchibisov
Copy link
Member

Are you sure that you're not disabling title setting somewhere in the config or launch with the --title? You can try default config alacritty --config-file=/dev/null and then create by alacritty msg create-window.

@hiredman
Copy link
Author

hiredman commented Apr 4, 2023

Ah, I see, somewhere I did launch another alacritty with --title, and now all my terminals are children of that process, and those are the ones where setting the title isn't working.

It seems like either children of alacritty process started with --title should be able to set their own title, or those children should use the title set with --title too.

@kchibisov
Copy link
Member

Hm, yeah, you're correct.

I think we shouldn't persist the --title on the CLI for the terminals created with the alacritty msg create-window.

Not sure about the binding though, what do you think @chrisduerr ? The issue is that running alacritty --title foo will create an instance with title foo, but then alacritty msg create-window will create a window with fixed title Alacritty(default).

@kchibisov kchibisov changed the title Setting title doesn't work in terminals launched via 'msg create-window' Setting title doesn't work in terminals launched via 'msg create-window' when instance was created with --title Apr 5, 2023
@chrisduerr
Copy link
Member

Should probably be persisted, yeah.

@kchibisov
Copy link
Member

Persisted or reset to dynamic one? I think we should reset to dynamic, because alacritty msg create-window has the --title option?

@chrisduerr
Copy link
Member

Honestly I don't really care either way.

@shmibs
Copy link

shmibs commented Apr 21, 2024

making children handle their own titles dynamically would be appreciated here (until then children are unusable because they can't be differentiated in window switcher 😅

chrisduerr added a commit to chrisduerr/alacritty that referenced this issue Apr 22, 2024
This fixes an issue where Windows spawned after the initial one through
IPC or bindings would not update their title due to the initial window
having its title set through the CLI.

Title changes are still inhibited for additional windows when they are
spawned through `alacritty msg create-window` with the `--title` CLI
option added.

Closes alacritty#6836.
chrisduerr added a commit to chrisduerr/alacritty that referenced this issue Apr 22, 2024
This fixes an issue where Windows spawned after the initial one through
IPC or bindings would not update their title due to the initial window
having its title set through the CLI.

Title changes are still inhibited for additional windows when they are
spawned through `alacritty msg create-window` with the `--title` CLI
option added.

Closes alacritty#6836.
chrisduerr added a commit that referenced this issue Apr 23, 2024
This fixes an issue where Windows spawned after the initial one through
IPC or bindings would not update their title due to the initial window
having its title set through the CLI.

Title changes are still inhibited for additional windows when they are
spawned through `alacritty msg create-window` with the `--title` CLI
option added.

Closes #6836.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants