-
Notifications
You must be signed in to change notification settings - Fork 186
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
Windows 11 taskbar icon twitching #1263
Comments
2 would break existing workflows, 1 would break expectations about the title. |
Thanks. Can you please elaborate, as I understand neither of your points.
I don't see how anything would break if you added an option and kept the current behavior the default.
You mean it would break users which only use the current control sequences and would now get empty tab title? In that case, couldn't the tab title equal the window title until the new ctrl seq occurs for the first time?
So a non-settable window title if there is a tabbar? That's not a solution to my problem, as I still want a meaningful window title, not just any fixed length one.
As soon as I'd sync, would I be back at my initial abbreviation problem then? |
ad 1: The control sequence OSC 2 is described to set the title to the given string, not part of it. People may wish to keep that but still get the remedy to be agreed. A sequence that sets the actual window title (e.g. the sync sequence) could be sent less frequently, for example only when the working directory is changed in the shell. Or, with the "tab title only" mode enabled, a new sequence could be used to set the window title. |
ad 1: In my suggestion 1, I don't mean any change to window title setting at all. Only tab title (which is not covered by standard OSC 2, I assume, and is already being abbreviated) would be abbreviated in a different way. (Plus keeping the old behavior as default should mean that nothing breaks. And even if the new abbreviation mode is used, the "break" is purely visual, since there is no way to programmatically read the tab title anyway.) ad 2: Yeah, extra effort to use the new feature. That's why I prefer solution 1.
My window title changes twice per entered command, and I want to keep it that way. (That's why the "re-layouting" of the Windows 11 taskbar is so annoying.)
IIUC, for everyone who wants both titles, this would mean as much extra effort as my suggestion 2 (keep OSC 2 unchanged [window title and middle truncated tab title], add new CtrlSeq for tab title), just in a more confusing way. How about a solution "4"?
|
I've meanwhile tried to reproduce the original issue on Windows 11 but I don't see any effect of title changing to the taskbar. |
I'm currently not at my Windows 11 work computer, but I'll try:
=> The mintty taskbar button gets temporarily wider, causing the buttons to the right to move right. When that happens often and quickly, it almost feels like the taskbar is flickering. |
@mintty Assuming it's possible to set the taskbar icon label separately from the window title, have you considered using |
As far as I know this is not possible. (Otherwise I would have implemented distinct OSC 0/1/2) |
I do not see this option in Windows 11. How are taskbar icon titles enabled? |
Personalization / Taskbar / Taskbar behaviors / Combine taskbar buttons and hide labels must be set to "When taskbar is full" or "Never". |
I don't have that option in my taskbar behavior menu. Maybe with 23H2 which is just downloading? |
OK, I could now enable taskbar icon labels. The label is changed along with the window title as expected, clipped to some maximal length. I still do not see what you mean by "twitching". Everything looks fine for me. |
OK, I've now seen the difference to Windows 10. I had misunderstood the issue to be related to long labels but it's about short labels of different length (as long labels are clipped anyway), right? I'm pondering to offer the following solution, fitting into existing definitions of OSC sequences (but slightly tweaking them which might be considered unsuitable by some): |
The proposed design would be the reverse of what @j4james suggested, so apparently it's a matter of preference (and could be tweaked by an option). Still leaving open how to extend handling if one day we might have 3 distinct labels (window, tab, icon). |
It was further confusing the issue to relate it to the tab title as it arises alike without tabbar, at least as I now understand it. |
Sorry for the confusion. Yes, I'd like to have all taskbar buttons the same width, and that should be the maximum width or similar (except when the taskbar is full, causing all to shrink as needed). I'd like to get rid of short window titles and their shrinking taskbar buttons.
As far as the variable taskbar button width is concerned, you are right. The tab title comes into play when I pad the window title to get wide taskbar buttons, and then mintty abbreviates the relevant part of the title instead of the padding.
I'd like that max width.
But for the unpadded title "aaa bbb ccc", for example, the tab title gets abbreviated to "a…". (And unpadded "a" yields tab title "a…", so no information loss there, but not ideal either.) But now that you pointed me to non-breaking space, if mintty would simply set the tab title to the right-trimmed window title before doing it's (center) abbreviation, the U+A0 workaround would be all that I'd need. I don't think that that would break any reasonable expectations. |
I've uploaded a workaround for the taskbar icon twitching as discussed. The window title (which is also used as the taskbar icon label) is padded with 50 non-break spaces. Note that 39 is likely not enough as I also made the taskbar font configurable and you could use a narrower font. About the original request to separate window and tab title, this would need to add title management to mintty which is currently not available (the title contents is simply maintained as the Windows title and retrieved from it when needed). |
On Windows 10, the same procedure has a bad effect, so applying it only on Windows 11. |
Thank you very much! I have built master. But Windows Security doesn't let me execute it on my work computer, which is currently my only computer with Windows 11. I will try again in the next days. Sometimes, Windows Security changes its mind. |
I could now run the self-built mintty. When I run my test loop from #1263 (comment), with sufficiently large w, it looks good. But small w values still yield slim taskbar buttons. I.e. I still need to pad with U+00A0 myself, which is not a problem for me, but your comment sounds like it should not be necessary on the user's side anymore. |
I see no such effect from your script, provided I run it from an updated mintty instance. |
Hmm, strange. The about dialog in my self-built mintty.exe shows "mintty 3.7.1 (x86_64-pc-cygwin) [Windows 22631]" just like my installed version. Is that expected? Can Windows Security not only block, but also silently replace programs?? |
The version stays the same until the next release. (Something I already wanted to enhance for a while...) |
I do notice the improved tab title: So that's another confirmation that I'm running the self-built version. |
Excuse the question, your self-build was based on which sources? Did you get a fresh git pull? |
I guess a found an error in the patch, hold on. I wonder though, how I could test it successfully on Windows 11... |
OK, I'll answer anyway, in case it helps: |
The fix should now be fixed. Sorry for the confusion. |
No problem. Thank you very much! I've built commit 18d63f9. Let's see when Windows Security is ready to allow me run it… |
I can now confirm that mintty's padding works for me, e.g. unpadded Thanks a lot! |
Released 3.7.2. |
logs is: commit: f8a6c4d : Sep 15 2024 Merge commit from fork To determine whether a path has to be guarded via the `GuardNetworkPaths` config option, this function first calls `path_posix_to_win_w()`. However, that option itself tries to follow symbolic links and hence would access network paths already before the `PathIsNetworkPathW()` check had a chance to enable the safeguards. Since network calls are somewhat expensive, compared to local calls, be careful and special-case that condition. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> commit: 2cd47df : Sep 14 2024 Unicode 16.0 commit: e322d5d : Sep 13 2024 fix rendering of combined characters in South East Asian scripts (mintty#1285) commit: 2e596b9 : Sep 7 2024 doc option BoxDrawing (mintty#935, mintty#1119): Box Drawing characters are self-drawn commit: 4842997 : Sep 6 2024 avoid bottom padding artefacts of double-height self-drawn symbols commit: 9590bbc : Aug 31 2024 tweak initial window display, mitigate bright flash (mintty#1284) commit: c78ee10 : Aug 31 2024 tweak sixel parsing commit: 4bb1049 : Aug 26 2024 box drawing: revise dashed lines commit: 1e97733 : Aug 18 2024 box drawing: adjust heavy parts in mixed light/heavy boxes commit: f9c9f06 : Aug 18 2024 box drawing: square line ends commit: c1c1be3 : Aug 18 2024 complete Box Drawing coordinates; tweak box drawing; mixed light/heavy boxes still have some rough edges commit: c0c23d9 : Aug 11 2024 fix CopyTab=true behaviour (mintty#1281) commit: 724e940 : Aug 8 2024 self-draw Box Drawing characters (U+2500..U+257F) (mintty#935, mintty#1119), option BoxDrawing; without mixed characters (light/heavy, single/double) commit: cc6a2a2 : Aug 5 2024 wiki: control sequences format tweaks commit: 891c99e : Aug 2 2024 don't consider $HOME also for config if not existing (mintty/wsltty#351) commit: 40b9d0e : Jul 28 2024 fix and enable rendering for geometric Powerline symbols (mintty#979, mintty#943) commit: e59f44d : Jul 26 2024 fix dataflow glitch notified by gcc 12.4.0 commit: fa599e8 : Jul 24 2024 switch Emoji width mode setting to 2027; clarify wiki commit: 8728871 : Jul 23 2024 fix insert mode handling in emoji width mode commit: 17336b6 : Jul 23 2024 skip config files in $HOME if $HOME does not exist (mintty/wsltty#351) commit: 855b1b9 : Jul 23 2024 Emoji width mode (DECSET 7769) to always render emojis in 2-cell width. Dropped deprecated DECSET mode 2027. commit: 1d32229 : Jul 22 2024 some backwards compatibility tweaks commit: 02b82d6 : Jul 22 2024 Makefile: fix gcc-version-conditional gcc flags setup commit: 5195c16 : Jul 10 2024 setting Menu* to empty value disables the respective menu (mintty#1279) commit: b47a5e2 : Jul 10 2024 disable GB18030 workaround for cygwin since 3.5 which supports it natively commit: 0af74be : Jul 10 2024 tweaks around GB18030 encoding commit: 6af2cdf : Jul 2 2024 tweak revised AltGr handling to avoid sticky Ctrl state (mintty#1273, ~mintty#1266) commit: df84c27 : Jun 28 2024 prevent saving changed settings to /etc/minttyrc commit: c154c57 : Jun 28 2024 Update monokai-dimmed correct cursor color to match theme upstream commit: 48a0a71 : Jun 28 2024 Makefile: fix tagging vs version check commit: 7dd2ce7 : Jun 28 2024 rearrange Makefile commit: 5099825 : Jun 27 2024 Makefile: tweak pkg build commit: 2f5476c : Jun 27 2024 tweak Makefile to build with -j2 (mintty#1275) commit: ebb72c0 : Jun 27 2024 Update EditorConfig settings commit: dab1f3d : Jun 27 2024 add missing check for consistent git version commit: e4d3e41 : Jun 27 2024 lang tweaks commit: 530c103 : Jun 24 2024 fix artefacts from auto-narrowing end-of-line overhang (mintty#1179) commit: 073af5b : Jun 22 2024 Ctrl+Win+mouse-scroll zooms font even if ZoomMouse is off commit: ecb9771 : Jun 21 2024 unsqueeze the Options dialog slightly commit: 1365a18 : Jun 21 2024 fix CJK quote marks auto-expansion for FontChoice-set fonts (mintty#1271), code fixed in previous two commits commit: deb9391 : Jun 21 2024 Move the TATTR_EXPAND check down into write_ucschar Import the suggested changes. Co-authored-by: Thomas Wolff <mintty@users.noreply.github.com> commit: d007add : Jun 20 2024 Some CJK characters don't follow the FontChoice option The characters listed here (e.g. "「" (U+300C)) don't follow the FontChoice option: Consider the following settings: ``` Font=Anonymous Pro # ASCII font FontChoice=CJK:1 Font1=IPAGothic # Japanese font ``` U+300C is a double width character so `win_char_width()` should return 2 here: However, FONTFAM is not set to `term.curs.attr.attr` at this point, then `win_char_width()` returns 1 and the `TATTR_EXPAND` flag is unintentionally set. As the result, U+300C is not shown correctly. (The left half of the glyph of U+300C is expanded.) FONTFAM should be set before calling `win_char_width()`. commit: 78c7d20 : Jun 19 2024 wiki: conhost update to fix attribute mangling (mintty#1235, mintty#971) commit: e164702 : Jun 19 2024 commit: 5ba0f41 : Jun 19 2024 wiki: note about theme files overriding changed colour settings (mintty#1267) commit: acc887b : Jun 15 2024 confirmation for pasting multi-line clipboard contents (mintty#1268), option ConfirmMultiLinePasting commit: 5c7991c : Jun 15 2024 add "Show dim as font" to options dialog (option DimAsFont) commit: a79e7dd : Jun 13 2024 fix CopyTab=yes crash condition (mintty#1269) commit: 3e654f8 : Jun 13 2024 close clipbuf memory leak commit: a83ac77 : Jun 10 2024 tentatively changing default bold rendering as bold font, BoldAsFont=yes commit: 532b6fc : Jun 10 2024 render dim attribute as a Light font variation if available; option DimAsFont commit: be73970 : Jun 7 2024 revise AltGr handling to support flexible right-Alt+left-Ctrl combinations (mintty#1266) commit: 18d63f9 : Jun 4 2024 fix restriction to Windows 11 to pad window title (mintty#1263) commit: d8594d2 : May 26 2024 fix DSR Locator status response (ctlseqs mistake) commit: 4766cd5 : May 20 2024 pad window title only in Windows 11 (mintty#1263) commit: 2768551 : May 19 2024 pad window title to avoid taskbar icon width twitching in Windows 11 (mintty#1263) commit: 76eaa8b : May 18 2024 doc fallback to legacy wslbridge for old Windows versions (mintty/wsltty#350) commit: 09fc1a9 : May 12 2024 sharpen risk warning for AllowPasteSelection (mintty#1264) commit: 708234d : May 12 2024 support OSC 52 ? (mintty#1264) and OSC 52 empty/invalid, option AllowPasteSelection; drop AllowSetSelection from interactive Options menu commit: ec16bb7 : May 12 2024 warning for setting Charwidth=single* (mintty#1265) commit: 0b20fff : May 12 2024 function get_clipboard commit: 3cf4e68 : May 12 2024 fix base64_encode, add convenience wrapper and test case commit: 1a750e5 : May 9 2024 fallback to legacy wslbridge for old Windows versions (mintty/wsltty#350) commit: c8ead8f : May 5 2024 backport W2000 commit: e44aa56 : Apr 22 2024 escape sequence DECST8C reset tab stops (xterm 389, VT510); escape sequence DECRQDE request display extent (xterm 387, VT340) commit: 2fc08df : Apr 20 2024 avoid scrolling artefacts at overhanging emojis: mark emoji overhang in subsequent character position not only if that is a space but also with setting EmojiPlacement=full (mintty#1261); drop exemptions (for numbers and flag letters) from emoji space expansion (mintty#1104, 3.5.1) commit: 9374a3a : Apr 13 2024 restore wrap modes on return from VT52 mode commit: 8c30901 : Feb 24 2024 increased with of Options dialog for zh_CN localisation (~mintty#1257) commit: a36a271 : Feb 24 2024 add XTQMODKEYS to DECRQSS (mintty#1189, xterm 389) commit: 7c46b89 : Feb 24 2024 fix invisible and blinking attributes on background image commit: e70eeb3 : Feb 24 2024 extend previous workaround to chunks with combining characters commit: 5ed813a : Feb 24 2024 workaround for rendering failure of top-left background text on background image commit: 18e6b4c : Feb 22 2024 fix status area refresh, especially after restoring a minimized window commit: c34ad80 : Feb 20 2024 tweak DECRQCRA invisible character checksum value, after fix in xterm 390 commit: 56447df : Feb 16 2024 fix layout of Options dialog Selection pane (mintty#1257) commit: 0945070 : Feb 16 2024 German translation: fill gaps commit: 95b3bf6 : Feb 12 2024 fix legacy compatibility commit: 7e80dbd : Feb 10 2024 tweak DECRQCRA Rectangular Checksum to match xterm (~mintty#1225) commit: bf5dd26 : Feb 8 2024 add issue reference for previous fix (mintty#1254), 735d72f commit: c8222e0 : Feb 3 2024 semi-workaround for transparency loss when resizing unfocused grid-snapped window (mintty#1256) commit: faade2f : Feb 3 2024 fix conditional debug entries commit: 85b0e29 : Jan 24 2024 new rewrap per-line disable mode DECRST 7723 (deprecated 2027, mintty#1255) commit: afd564c : Jan 14 2024 revise tab syncing to fix Ctrl+ALT-switch after minimize/restore (mintty#1242 step 5) commit: 154cc1d : Jan 8 2024 drop DSR 53 (legacy xterm mistake, dropped in xterm 389) commit: 0d1d891 : Jan 7 2024 enhance debugging WM_STYLECHANGED details commit: f1712ae : Jan 4 2024 fix instable window switching after minimize/restore (mintty#1242, mintty#1249) commit: 91bb8ca : Dec 22 2023 design sketch for potential alignment of child codepage (~mintty#1248) commit: 68de1e3 : Dec 16 2023 new user-definable function intr (~mintty#1245) commit: f1f764a : Dec 13 2023 fix handling of options to be saved (mintty#1247) commit: c374559 : Dec 10 2023 Fix option index overflow in remember_file_options There are more than 256 config options (!), which means that using a uchar is no longer sufficient for storing the index of options found in the config file or changed in the UI. The overflow meant that for example a BoldBlue setting in the config file (which currently has option index 262) turned into a TekForegroundColour setting (with index 6) when changing some unrelated setting in the config dialog and saving. commit: 5d7f018 : Dec 10 2023 new user-definable key Alt for option KeyFunctions (mintty#1245) commit: 267b0c2 : Dec 10 2023 Support lone Alt key presses in KeyFunctions A lone Alt key press in Windows applications normally brings up the application menu bar (which is why its virtual keycode is VK_MENU). There's no such menu bar in mintty, which relies on the context menu and window menu instead, so make lone Alt key presses available for mapping in the KeyFunctions setting. The action is triggered when the Alt key is released, but only if no other modifier was down when the Alt key was pressed, and if nothing else was pressed in-between. Also make sure that AltGr does not trigger this action or Alt code processing, unless the AltGrIsAlsoAlt setting is enabled. One use case for this is to map Alt to the context menu via the 'menu-text' action, to make it easier to reach on keyboards that don't have the context menu key. Another is to map it to ^[, i.e. the Esc key code, which might be convenient for vim users. It also makes plenty of sense as Alt modifier combinations normally prefix the modified key with ^[. As the Esc key's default function can be replaced in this way, also make unmodified Esc key presses available for mapping in KeyFunctions. One use case for that is to map it to a non-letter control character such as ^\, and then use that as the interrupt character in the stty settings, instead of ^C. That gives Esc its usual Windows meaning of interrupting or cancelling actions, and makes ^C available for copying. commit: 735d72f : Dec 10 2023 tune and fix click-opening URL (mintty/wsltty#346)
So some genius at Microsoft thought it would be a great idea to make the Windows 11 taskbar twitch every time a command starts or ends in my zsh configuration (because that changes the window title and thereby often the taskbar button width).
I tried to counter that by simply adding lots of spaces and a dot at the end of the title, enough to make the button width static and the dot to be hidden. But then the mintty tab title is abbreviated near the beginning, i.e. something like "z… .".
Two possible remedies come to mind. Could you please add one of those? Or is there a better solution?
(1 sounds easy and is sufficient IMHO.) Thanks!
The text was updated successfully, but these errors were encountered: