bug#81666: 31.1; browse-url fails in emacsclient -nw
Eli Zaretskii <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
> From: समीर सिंह Sameer Singh <[email protected]> > Date: Fri, 21 Aug 2026 02:45:33 -0500 > Cc: [email protected], [email protected], [email protected], > [email protected], [email protected] > > Eli Zaretskii <[email protected]> writes: > > >> From: Abdulnafé Toulaïmat > >> <[email protected]> > >> Cc: Po Lu <[email protected]>, Stefan Monnier <[email protected]>, > >> martin rudalics <[email protected]>, Yuuki Harano <[email protected]>, > >> [email protected] > >> Date: Fri, 21 Aug 2026 08:55:36 +0200 > >> > >> Eli Zaretskii <[email protected]> writes: > >> > >> > This error is specific to a PGTK build, and comes from browse-url here: > >> > > >> > ;; When connected to various displays, be careful to use the display of > >> > ;; the currently selected frame, rather than the original start display, > >> > ;; which may not even exist any more. > >> > (let ((dpy (frame-parameter nil 'display)) > >> > classname) > >> > (if (stringp dpy) > >> > (cond > >> > ((featurep 'pgtk) > >> > (setq classname (pgtk-backend-display-class)) <<<<<<<<<<<<<<< > >> > (if (equal classname "GdkWaylandDisplay") > >> > (progn > >> > ;; The `display' frame parameter is probably wrong. > >> > ;; See bug#53969 for some context. > >> > ;; (setenv "WAYLAND_DISPLAY" dpy) > >> > ) > >> > (setenv "DISPLAY" dpy))) > >> > > >> > All this is conditioned on "(frame-parameter nil 'display)" returning > >> > a string, which AFAIU is not expected in the -nw case. So the first > >> > question is: what does "(frame-parameter nil 'display)" yield in your > >> > case, in the scenario you describe, just before you invoke browse-url > >> > from the client frame? > >> > > >> > (FWIW, I tried to reproduce this in a PGTK build I have here, but > >> > couldn't: I see no error in this case. And frame-parameter returns > >> > nil in my case, as expected.) > >> > >> Hello, thanks for looking into this. > >> > >> In the emacsclient TTY frame, I get ":0". This does indeed appear to be > >> the main culprit, because in an *emacs* TTY frame, I get nil, as you > >> describe. > > With some grepping it appears to be because of commit: > e2b64f8999f79a5820ba00d2987885d7dda492d5 > > which solves bug#54844 Thanks, but I still don't see why this should cause the problem in the PGTK builds. That change only affects GUI frames, or at least that's my reading of the code.