Created attachment 260162 [details] Log after CRT+C My laptop is a ThinkPad X13 with an i5-10210U processor and I'm using the drm-61-kmod-6.1.128.1402000_2 driver. When I log in using Wayland mode, pressing "Ctrl+C" causes the system to automatically return to the SDDM interface. I'm not sure how to provide further debugging information.
Upstream bug report: https://bugs.kde.org/479679
(In reply to Max Brazhnikov from comment #1) seems it is unrelated issue. Could you run Plasma from console, rather than from SDDM, and check for ctrl+c?
The Ctrl+C issue appears to only manifest when starting Plasma from SDDM. When I start it from the console using the following incantation, Ctrl+C works fine: ck-launch-session /usr/local/lib/libexec/plasma-dbus-run-session-if-needed startplasma-wayland But obviously not a very user-friendly solution :-) I suspect this may have something to do with the fact that SDDM runs X11 at the same time Plasma runs Wayland. Perhaps there is some kind of conflict. I was unable to get SDDM itself to run using Wayland (I last tried a few months ago).
It is definitely some king of interplay between SDDM and Plasma Wayland. For example, Wayfire is not affected by this. Moreover, the issue is not always reproducible with Plasma: after pressing some random keys Ctrl-C does not trigger session termination.
(In reply to Cullum Smith from comment #3) Thank you. After using ck-launch-session, Ctrl+C no longer exits. there is still an issue: right-clicking on the desktop causes the desktop process to exit (the screen displays black). Do I need to submit a new bug ticket?
(In reply to Haowu Ge from comment #5) plasma_session
Just commenting as a kind of "me too". There's a difference between the right-click, which was helped by doing what the upstream bugreport's comments suggest and adding: CXXFLAGS+= -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=2 ..to my /etc/make.conf or the Poudriere equivalent, and then rebuilding graphics/qt6-wayland with this set. The Ctrl-C issue remains when starting a Wayland session from SDDM, but it's not present when starting from the console the way Cullum Smith's comment here shows.
Upstream report: https://bugs.kde.org/505552
Closed upstream; and see Peter Wemm's response to <https://mastodon.bsd.cafe/@grahamperrin/114888161580474815>.
I did all steps from the FreeBSD Handbook from Install up to X11 install and Desktop Environment configuration. After KDE Plasma install (with SDDM) https://docs.freebsd.org/en/books/handbook/desktop/#kde-start I got the described problem - Ctrl-C exits environment to login screen of SDDM. I suppose this bug affects all who install FreeBSD and DE according to the Handbook. If I remove sddm and install lightdm with KDE, this bug does not appear. I think, it is connected to sddm in same way. FreeBSD 14.3, amd64, graphics processor Intel.
(In reply to Vladlen Popolitov from comment #10) bug #288627
It could be related to the VT still taking keyboard inputs e.g ctrl+C even after ioctl(ttyfd,KDSETMODE,KD_GRAPHICS). That does not seem to happen on Linux. Possible reproducers: I am in console mode tty2/ttyv2 on linux/freebsd. cat linuxttytest.c #include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include <linux/kd.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> int main() { int fd = open("/dev/tty2",O_RDONLY | O_NOCTTY); ioctl(fd,KDSETMODE,KD_GRAPHICS); sleep(10); ioctl(fd,KDSETMODE,KD_TEXT); } cat freebsdttytest.c #include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include <unistd.h> #include <sys/consio.h> #include <fcntl.h> #include <errno.h> int main() { int fd = open("/dev/ttyv2",O_RDONLY | O_NOCTTY); ioctl(fd,KDSETMODE,KD_GRAPHICS); sleep(10); ioctl(fd,KDSETMODE,KD_TEXT); } Note that on FreeBSD you can use ctrl+c during the sleep...
Created attachment 264502 [details] add raw kbd mode ioctl Looking at what Xorg does, this raw kbd mode makes it not impossible to invoke ctrl+c in the tty...
(In reply to Jesper Schmitz Mouridsen from comment #13) Seems to work for me. CTRL+C now does what it's supposed to do and CTRL+Z does not freeze the entire session. Will test more in the next few days.
(In reply to Jesper Schmitz Mouridsen from comment #13) This resolves the issue for me as well
(In reply to Fabio Comolli from comment #14) I just discovered that just typing in a Librewolf page the character " (SHIFT+2 on the Italian keyboard) logs out immediately from a sddm+Wayland session, so I guess this issue is not completely fixed.
(In reply to Fabio Comolli from comment #16) Yeah, I looked again and the key mapping just happens to change so that SHIFT + " gets interpreted as CTRL-C
As a temporary workaround I have had some success adding "stty intr undef" near the top of the script located at: /usr/local/share/sddm/scripts/wayland-session
(In reply to Wes Frazier from comment #18) Using the standard sddm package or the patched one?
(In reply to Fabio Comolli from comment #19) With the standard sddm package.
(In reply to Wes Frazier from comment #20) Ok, this seems to get take care of the CTRL-C issue but CTRL-Z still hangs the whole session with the standard package.
You are correct. Adding a number of stty lines makes it more robust. Im now adding: stty intr undef stty susp undef stty dsusp undef stty quit undef stty stop undef stty kill undef To intercept more control characters. This should cover crtl+z and a few others.
(In reply to Wes Frazier from comment #22) Works for me. I don't know if it's acceptable, though.
(In reply to Fabio Comolli from comment #23) Yeah, it's a temporary workaround at best. It's not a propper or elegant solution.
(In reply to Wes Frazier from comment #22) Right, because this is just undefining all the various key-combo interrupts in the root tty; it doesn't actually fix that this tty is still capturing signals that it shouldn't.
Created attachment 264712 [details] Try to mimic seatd. This is setting the underlying tty in raw mode as per here https://github.com/freebsd/freebsd-src/blob/7d6221ff14478ce70fab24c58e0326ff5c4baf52/lib/libc/gen/termios.c#L159-L160C1. So the key combos would not reach the vt IIUC. Works for me (fingers crossed) Inspired by the seatd terminal_set_keyboard function
Created attachment 264713 [details] same but in git format
(In reply to Jesper Schmitz Mouridsen from comment #27) Unfortunately since I went back to 14.3 I'm unable to compile sddm from ports (not relatred to the patch); as such, I'm unable to test this fix.
Patch seems to have done the trick for me. I dropped it into /usr/ports/x11/sddm/files and rebuilt sddm via ports and is working flawlessly for me now. I tested Crtl+C, Crtl+Z, and SHIFT+". (And I did make sure my changes to /usr/local/share/sddm/scripts/wayland-session had reverted. )
Works for me too. (In case anyone may be interested, to compile from ports when using pkgbase you need not only FreeBSD-clang but also FreeBSD-clang-dev).
Unfortunately I'm still seeing the same behavior, but with different key combos. Ctrl-C no longer breaks things, but now other things do, like Shift-@.
(In reply to Dan Kotowski from comment #31) Cannot reproduce it with Italian keyboard - @ and shift-@ (which translates to ΒΈ) work just fine as you can see from this comment.
(In reply to Dan Kotowski from comment #31) Cannot reproduce the Shift+@ behavior with this last patch. Keyboard locale information from my system: lang_default = en dialect = C.UTF-8 lang_abk = C.UTF-8 Currently supported languages: da de el en es fr he hy no pl pt ru sv tr uk
$ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_ALL= Keyboard is set to Generic 104
(In reply to Dan Kotowski from comment #34) Cannot reproduce it, sorry. Keyboard is now set to English-US - Generic 104 and I can reliably hit @, which by the way is now SHIFT-2. [15:40][fmc000@tu45b-freebsd ~]$ env|grep LC LC_ALL= LC_MESSAGES=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 [15:42][fmc000@tu45b-freebsd ~]$
After some poking and prodding with jsm, we found the last issue on my end was user error, as I needed to run an explicit `pkg upgrade -f sddm` after rebuilding. The latest patch does sufficiently fix Ctrl-C, -Z, and Shift-2.
Created attachment 264776 [details] v3 Iteration upon https://bugs.freebsd.org/bugzilla/attachment.cgi?id=264713&action=edit. Align whitespace, block for FreeBSD, and make more robust (fail on non-zero returns, use qFatal() before attempting next block.
(In reply to Jason E. Hale from comment #37) FWIW, v3 works fine here. Tested with both Italian and English (US) layout: CTRL-C, CTRL-Z, " and @.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=b7d53d8438e66f84768f28cbccc92a04d5df76b8 commit b7d53d8438e66f84768f28cbccc92a04d5df76b8 Author: Max Brazhnikov <makc@FreeBSD.org> AuthorDate: 2025-10-24 11:45:43 +0000 Commit: Max Brazhnikov <makc@FreeBSD.org> CommitDate: 2025-10-24 11:45:57 +0000 x11/sddm: add workaround for Wayland sessions. Mimic seatd and put the underlying tty in raw mode to prevent killing Wayland sessions on CTRL+C. Upstream reports: KDE: https://bugs.kde.org/505552 SDDM: https://github.com/sddm/sddm/issues/1986 PR: 286592 Submitted by: jsm, jhale x11/sddm/Makefile | 2 +- .../patch-src_common_VirtualTerminal.cpp (new) | 30 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-)
A commit in branch 2025Q4 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=538fd5a82f20a383e9220eb0c2b798f4d50e1cef commit 538fd5a82f20a383e9220eb0c2b798f4d50e1cef Author: Max Brazhnikov <makc@FreeBSD.org> AuthorDate: 2025-10-24 11:45:43 +0000 Commit: Max Brazhnikov <makc@FreeBSD.org> CommitDate: 2025-10-24 11:47:02 +0000 x11/sddm: add workaround for Wayland sessions. Mimic seatd and put the underlying tty in raw mode to prevent killing Wayland sessions on CTRL+C. Upstream reports: KDE: https://bugs.kde.org/505552 SDDM: https://github.com/sddm/sddm/issues/1986 PR: 286592 Submitted by: jsm, jhale (cherry picked from commit b7d53d8438e66f84768f28cbccc92a04d5df76b8) x11/sddm/Makefile | 2 +- .../patch-src_common_VirtualTerminal.cpp (new) | 30 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-)
Thanks all for testing. jsm@, jhale@ thank you for the patches!
Reopen, there's still a problem. When Plasma Wayland is launched via patched sddm, pressing alt+Fx, for example alt+F2, switches to the corresponding VT instead of opening Krunner. Moreover, the screen is actually not repainted after the first alt+Fx and you do not see text terminal, but "frozen" Plasma instead. You have to switch to another vt to get visible prompt. Pressing alt+F10 brings you to the Plasma, and you also see that Plasma has caught you first "alt+F2" and opened Krunner for you. When Plasma is started from the terminal, it works as expected: ctlr+alt+Fx switches from Plasma to vt without any problem.
(In reply to Max Brazhnikov from comment #42) I DO NOT experience the Alt-Fx vt-switch bug as described in 1st. I DO experience the the Alt-Fx redraw bug as described in 2nd.
(In reply to Dan Kotowski from comment #43) > I DO NOT experience the Alt-Fx vt-switch bug as described in 1st. How do you start Plasma? From display manager or from VT?
(In reply to Max Brazhnikov from comment #44) From SDDM login screen
(In reply to Max Brazhnikov from comment #42) Bug 291368