Control: retitle -1 screen: corrupts the main terminal screen after detach due to lack of utmp in systemd 257
On 2025-05-04 23:51:46 +0200, Vincent Lefevre wrote: > In short, the issue may be been introduced with the systemd upgrade > from 256.7-1 to 257.5-2 (the very old machine on which I do not see > the issue has systemd 255.5-1). The main thing that could affect screen is that utmp has been disabled in systemd 257: screen uses utmp when attaching and detaching sessions (via utempter) and the issue seems to occur when detaching a session. I've first recompiled the screen package, and the issue still occurs. Removing utempter support in debian/rules by either removing the --enable-utempter option or changing it to --disable-utempter has no effect, but if I understand correctly the configure.ac file, this option is not used! Well, this seems to be due to a typo: AC_ARG_ENABLE(utempter, [ --enable-utempter enable utempter support]) if test "$enable_pam" = "yes"; then AC_CHECKING(ut_host) AC_TRY_COMPILE([ #include <time.h> #include <sys/types.h> #if defined(SVR4) && !defined(DGUX) #include <utmpx.h> #define utmp utmpx #else #include <utmp.h> #endif ],[struct utmp u; u.ut_host[0] = 0;], AC_DEFINE(UTHOST)) AC_CHECK_HEADER(utempter.h, have_utempter=yes, have_utempter=no) if test "$have_utempter" = yes; then AC_DEFINE(HAVE_UTEMPTER) LIBS="$LIBS -lutempter" fi fi Instead of if test "$enable_pam" = "yes"; then it should be if test "$enable_utempter" = "yes"; then Now, if I fix that and remove --enable-utempter from debian/rules, the screen binary is no longer linked against libutempter... and the issue has disappeared. However, I get the following error message: /var/run/utmp: No such file or directory I think that utmp support should completely be removed from screen. Note: I still don't know the actual cause of the terminal screen corruption, and whether this is due to a bug in screen itself or the libutempter library. I would have expected errors related to the lack of utmp support in systemd to be silently ignored internally, but this lack of utmp support has apparently bad side effects. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)