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

OSC 9;4 for progress reporting conflicts with OSC 9 notifications #8011

Closed
mbeniamino opened this issue Nov 1, 2024 · 4 comments
Closed
Labels

Comments

@mbeniamino
Copy link

Describe the bug
kitty interprets OSC 9;4 sequences for progress reporting as notifications requests. As far as I understand this is not strictly a bug, but rather a conflict in different specifications. The reason I'm opening the issue is to bring to your attention that systemd is introducing the use of OSC 9;4 sequences for progress reporting in v257 and this could raise the issue in the wild. See this thread by Lennart Poettering: https://mastodon.social/@pid_eins/113406672373007116 .

To Reproduce
Steps to reproduce the behavior:
to see the problem you can build systemd and run the test ./build/test-progress-bar

Screenshots
image

Environment details

kitty 0.36.4 created by Kovid Goyal
Linux whiterabbit 6.11.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 22 Oct 2024 18:31:38 +0000 x86_64
Arch Linux 6.11.5-arch1-1 (/dev/tty)

DISTRIB_ID="Arch"
DISTRIB_RELEASE="rolling"
DISTRIB_DESCRIPTION="Arch Linux"
Running under: Wayland (sway version 1.9) missing: blur
OpenGL: '4.6 (Core Profile) Mesa 24.2.5-arch1.1' Detected version: 4.6
Frozen: False
Fonts:
  medium: NotoSansMono-Regular: /usr/share/fonts/noto/NotoSansMono-Regular.ttf:0
          Features: ()
    bold: NotoSansMono-Bold: /usr/share/fonts/noto/NotoSansMono-Bold.ttf:0
          Features: ()
  italic: NotoSansMono-Regular: /usr/share/fonts/noto/NotoSansMono-Regular.ttf:0
          Features: ()
      bi: NotoSansMono-Bold: /usr/share/fonts/noto/NotoSansMono-Bold.ttf:0
          Features: ()
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib/kitty
  extensions dir: /usr/lib/kitty/kitty
  system shell: /bin/zsh

Config options different from defaults:

Important environment variables seen by the kitty process:
	PATH                                /home/benji/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/rocm/bin:/usr/lib/rustup/bin
	LANG                                it_IT.UTF-8
	EDITOR                              nvim
	SHELL                               /bin/zsh
	DISPLAY                             :0
	WAYLAND_DISPLAY                     wayland-1
	USER                                benji
	XCURSOR_SIZE                        24
	XDG_BACKEND                         wayland
	XDG_SEAT                            seat0
	XDG_SESSION_TYPE                    wayland
	XDG_CURRENT_DESKTOP                 sway
	XDG_SESSION_CLASS                   user
	XDG_VTNR                            1
	XDG_SESSION_ID                      1
	XDG_RUNTIME_DIR                     /run/user/1000
	XDG_DATA_DIRS                       /home/benji/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/

Additional context

Related links extracted from the thread:

microsoft/terminal#8055
https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC

@mbeniamino mbeniamino added the bug label Nov 1, 2024
@kovidgoyal
Copy link
Owner

OSC 9 was used for notifications long before windows terminal even
existed. kitty for example added support for it in 2019
#1474 based on it pre-exisitng
for years before that. Windows terminal added its conflicting
implementation in 2021: microsoft/terminal#8166

I strongly suggest the systemd maintainer do some research before implementing
a feature that will break widely used Linux terminals because he wants
to log in from windows to Linux.

And just for the record, I dont personally care about OSC 9. kitty has
the much more capable OSC 99 protocol for notifications. However, I do
care about not breaking existing scripts/programs that kitty users use
lots of which will exist for an escape code that has been in circulation
for so many years.

@kovidgoyal
Copy link
Owner

I decided to have kitty drop OSC 9 notifications that start with 4; just in case systemd is stubborn about doing the right thing as I dont want to be drowned in endless bug reports about this. See related commit for details.

@rudism
Copy link

rudism commented Dec 3, 2024

Just noting that this occurs in kitty 0.37.0 when using the dotnet CLI from the latest .NET core 9 SDK for Linux. For example when building a project I get spammed with 4;3; and 4;0; notifications. They must have added progress reporting in .NET 9 because using the dotnet CLI from the .NET 8 SDK didn't exhibit the same problem.

@Aerocatia
Copy link

Windows Terminal's interpretation of the escape sequence comes from ConEmu and has existed since at least 2012 (reportedly from "build 120520d" which is a date, 2012-05-20).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants