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

Title resets when window is minimised #27

Closed
fnxweb opened this issue Jul 9, 2019 · 18 comments
Closed

Title resets when window is minimised #27

fnxweb opened this issue Jul 9, 2019 · 18 comments

Comments

@fnxweb
Copy link

fnxweb commented Jul 9, 2019

When a KiTTY window is minimised, the title gets reset to either the title it first set upon connection (usually “hostname - KiTTY”) or the one that was current when the settings dialogue was last opened.

E.g., when bash's PROMPT_COMMAND is set to show the current directory in the title, this is cleared to the above upon minimise. If the window settings are opened while it is set to a directory (and that dir. is then shown in the settings' window title), then that is the value to goes back to in the future when minimised (even if apply isn't clicked to close the dialogue).

@lars18th
Copy link
Contributor

Hi,

I confirm that this bug continues.

Try this @cyd01 please:

  • kitty.exe -title TEST ...

Then the NAME of the Window will be for example the path of the shell. After that you can minimize the window. And after you can reopen the window, but then you'll see that the TITLE NAME is now "TEST" instead of the previous one.

I hope you can fix it.
Regards.

@lars18th
Copy link
Contributor

Please @fnxweb check last version. I feel this bug is solved.

@fnxweb
Copy link
Author

fnxweb commented Jan 13, 2020

Bug still present in 0.73.1.5 I'm afraid.

@lars18th
Copy link
Contributor

Hi @cyd01 ,

Tested with the last version 0.73.2.3: If I execute kitty.exe -title TEST ... then the word "TEST" appears in the Title Window. All OK. And I can minimize and restore, and it works.

However, if after that I execute kitty.exe ... (that's without changing the title with the parameter -title) then continues to appear the word "TEST" in the title. I feel something is stored from the previous session.

Please, check it. Other than that, I think the problem is solved.
Regards.

@cyd01
Copy link
Owner

cyd01 commented Feb 12, 2020

I did not reproduced. I've checked the code (search for -title in window.c).

		} else if( !strcmp(p, "-title") ) {
			i++ ;
			conf_set_str( conf, CONF_wintitle, argv[i] );

The is no reason for the specified title is stored ... are you sure you did not save the session before running it (check Window\Behavior panel) ?

@lars18th
Copy link
Contributor

I did not reproduced. I've checked the code (search for -title in window.c).

		} else if( !strcmp(p, "-title") ) {
			i++ ;
			conf_set_str( conf, CONF_wintitle, argv[i] );

The is no reason for the specified title is stored ... are you sure you did not save the session before running it (check Window\Behavior panel) ?

No. I run it from the command line! 😨

@fnxweb
Copy link
Author

fnxweb commented Feb 17, 2020

The issue is still present in 0.73.2.3 I'm afraid.

  • Open a session — my login sets the title to the CWD immediately (“title 1”)
  • Minimise then un-minimise window : title is reset to “IP-address/host - KiTTY”
  • Set the title via the session / terminal escape sequences (“title 2”)
  • Open settings and just then close settings : “title 2” “stored”
  • Change title again (“title 3”)
  • Minimise then open again: title has reverted to “title 2”

@lars18th
Copy link
Contributor

Hi @fnxweb ,

I think the same, the problem is not fixed. Something is wrong in the logic of the windows's title.

Regards.

@systemmonkey42
Copy link
Contributor

Hi @cyd01

The issue is still present in 0.73.2.4. (Portable, if that makes a difference).

Any attempt to resize the window will immediately reset the window title to the original title (either whatever is configured/saved in the config, or the default "HOST - KiTTY" title)

Regards

@lars18th
Copy link
Contributor

Hi @systemmonkey42 ,

Then it will clear that's a problem with the title management. I hope @cyd can fix it at some point.

Regards.

@systemmonkey42
Copy link
Contributor

systemmonkey42 commented Mar 4, 2020

I think I've found the source of the problem.

Open kitty.ini and look for wintitle= in the KiTTY section.

Setting wintitle=no will keep remotely set titles

The default causes the remotely set title to be cleared every time the window size changes.

@fnxweb
Copy link
Author

fnxweb commented Mar 4, 2020

I don't think that'll help my use case, since I'm trying to keep my remotely set window titles, not disable them.

@systemmonkey42
Copy link
Contributor

My wording is not the best. The default of wintitle=yes resets the remotely set title on every window size change.

Set it to no to allow remotely set title to stay set.

This does not disable remotely set titles.

@fnxweb
Copy link
Author

fnxweb commented Mar 5, 2020

Confirmed, thanks @systemmonkey42 — setting [KiTTY] / wintitle=no in a kitty.ini next to kitty.exe fixes/works around the problem.

I don't know what that setting is intended to do, it's not a mirror of the enable/disable-remote-window-titles setting in the GUI, so I don't know if there's another side effect.

@lars18th
Copy link
Contributor

lars18th commented Mar 5, 2020

Hi,

As defined here:

X(BOOL, NONE, no_remote_wintitle) /* disable remote retitling */ \

write_setting_b_forced(sesskey, "NoRemoteWinTitle", conf_get_bool(conf, CONF_no_remote_wintitle));

The [KiTTY] / wintitle=no entry is to disable all the title management. But as defined here it's too another config variable to enforce a title:
write_setting_s(sesskey, "WinTitle", conf_get_str(conf, CONF_wintitle));

Futhermore, if you check the code searching for "wintitle" your see lines like these:

if (!term->no_remote_wintitle)

sfree(dp->wintitle);

IMO, I feel the problem is related to an inconsistent processing of the title. I suspect that multiple actors are changing the title. Then some refactoring is required.

I hope it helps.
Regards.

@lars18th
Copy link
Contributor

Hi @cyd01 ,

Do you reviewed the code regarding the wintitle variable?

@cyd01
Copy link
Owner

cyd01 commented May 14, 2020 via email

@cyd01
Copy link
Owner

cyd01 commented Sep 12, 2020

Title is controlled by window event of course ... but it is controlled by terminal too.
You must check disable remote-controlled window title changing in Terminal/Features configuration panel.

@cyd01 cyd01 closed this as completed Sep 19, 2020
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

4 participants