Skip to content

Improved support for debugging GUI apps: Copy Environment Feature #78

@softworkz

Description

@softworkz

Problem

When debugging a GUI application this is typically supposed to run inside a desktop environment.

In an SSH session there's no such desktop environment, so the usual scenario you want is

  • You're logged into the target machine through a different connection having a desktop session
    e.g. remote desktop (rdp/vnc) or the virtual display of a VM
  • In order for the debugged app to appear in that desktop session, a number of environment variables need to be set
    The usually required ones are:
    • DISPLAY
    • WAYLAND_DISPLAY
    • DBUS_SESSION_BUS_ADDRESS
    • XDG_RUNTIME_DIR
    • XDG_CURRENT_DESKTOP
    • XAUTHORITY
    • (and others)

The latter one (XAUTHORITY) is of special interest, because it often changes per session (but there may be others as well).

Proposed Solution

Introduce a Copy Environment From feature.

It would work like this:

  • Add a CopyEnvironmentFrom property to the debug profile
  • User can enter the name of a process
    which will be something like: Xwayland, gnome-shell, plasmashell, ksmserver, xfce4-session, sway, wayland-desktop, kwin_wayland, kwin_x11, Xorg
  • Before launching the debugger, the extension executes a script over ssh which
    • finds the id of a running process of that name (and is owned by the same user)
    • executes cat /proc/{pid}/environ
  • Then, the extension will add all those variables (except those which are explicitly specified in the profile) to the debugger launch command

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions