[SRU]

Built changes in
https://launchpad.net/~pushkarnk/+archive/ubuntu/ghostty-sru1

* Results:
 - ghostty: resolute/ghostty/1.3.0~us1-0ubuntu1.2 [amd64]
    + ✅ ghostty on resolute for amd64   @ 23.09.26 03:00:04  Log 🗒️
  - ghostty: resolute/ghostty/1.3.0~us1-0ubuntu1.2 [amd64v3]
    + ✅ ghostty on resolute for amd64v3 @ 22.09.26 03:27:03  Log 🗒️
  - ghostty: resolute/ghostty/1.3.0~us1-0ubuntu1.2 [arm64]
    + ✅ ghostty on resolute for arm64   @ 22.09.26 03:27:19  Log 🗒️

** Description changed:

+ [Impact]
+ Hard-coding `--shell-integration-features=ssh-env` in ghostty's 
desktop-launcher ignored user-configuration.
+ But launching ghostty from a terminal did not have this issue. This SRU 
removes the hard-coding, but
+ retains the the `ssh-env` default, while letting the user-configuration merge 
with it. If the user-configuration
+ includes `no-ssh-env`, the default is overridden.
+ 
+ There are three goals here, and the SRU addresses [2] and [3]:
+   1. Maintaining a good default user-experience for ghostty.
+   2. Letting the user-configuration merge with, and override the defaults.
+   3. Uniformity in the way the desktop-launcher and command-line launching 
deal with user-configuration.
+ 
+ [Test plan]
+ The following behavior can be reproduced be ghostty package version 
1.3.0~us1-0ubuntu1.1 or before, on Ubuntu 26.04.
+ 
+ 1. Add the following line to the ghostty config file: 
+    shell-integration-features = no-cursor
+ 
+    $ echo "shell-integration-features = no-cursor" >>
+ ~/.config/ghostty/config.ghostty
+ 
+ 2. Next, close ghostty and reopen it using the desktop launcher. The blinking 
cursor is still seen. This means the user config
+ of "no-cursor" was ignored. Also, $GHOSTTY_SHELL_FEATURES still contains 
'cursor-blink'.
+ 
+    $ echo $GHOSTTY_SHELL_FEATURES
+    cursor:blink,path,ssh-env,title
+ 
+ 3. Now, launch another instance of ghostty from the command line. This 
launches with the expected block cursor. Also, GHOSTTY_SHELL_FEATURES
+ has the expected values:
+ 
+    $ echo $GHOSTTY_SHELL_FEATURES
+    path,title
+ 
+ This reveals the two reported issues:
+ 1. User configuration is ignored with the desktop launcher (from GNOME's app 
grid)
+ 2. The desktop launcher and launching ghostty through a CLI command handles 
user-configuration differently.
+ 
+ Running 1-3, with the fix:
+ Launching ghostty using either the desktop launcher, or command should show 
the expected block cursor. 
+ And GHOSTTY_SHELL_FEATURES should show:
+    $ echo $GHOSTTY_SHELL_FEATURES
+    path,title
+ 
+ [Where problems could occur]
+ With this SRU, both ways of launching ghostty uniformly deal with 
shell-integration features in the user-configuration. We maintain
+ the `ssh-env` default in both cases. However,`ssh-env` comes with 
consequences which were only seen with the desktop-launcher, prior to this 
change. 
+ They will now be extended to command-line launching. This may cause 
regressions among users that launch ghostty through a command,
+ which is unlikely to be as common as using the desktop-launcher.
+ 
+ The next section details the rationale of adopting `ssh-env`, its
+ drawbacks and other challenges.
+ 
+ [Other info]
+ We are now talking about the need for `ssh-env` and its drawbacks, which are 
technically beyond the scope of this SRU.
+ 
+ > Why does the ghostty package have `shell-integration-features=ssh-env` by 
default?
+ As debian/patches/default-shell-integration-ssh-env.patch describes, Ghostty 
propagates TERM=xterm-ghostty
+ while ssh'ing to remote hosts. Even if a remote host has the latest 
`ncurses-term` installed it may only
+ recognize TERM=ghostty. Not recognizing TERM means programs cannot lookup 
terminal features; the terminal
+ experience severely degrades. Ghostty's `shell-integration-features=ssh-env` 
effectively sets TERM=xterm-256color
+ on the remote host, working around the issue of not recognizing $TERM.
+ 
+ > What are the consequences of `shell-integration-features=ssh-env`?
+ The default `ssh-env` comes with the following consequences, but maybe only 
for the advanced user:
+ 1. Setting `shell-integration-features=ssh-env` installs an ssh() bash 
wrapper function. See [1].
+ This will silently replace a user's ssh() if they have one defined.
+ 2. Even if a user does not define their ssh() but passes ssh options using 
-o, those options are overridden. 
+ 
+ Such a user may choose to disable `ssh-env` in their user-configuration,
+ which should be honored as a result of this SRU.
+ 
+ > Does this situation have a solution better than `ssh-env`?
+ Dropping `ssh-env` from the defaults and letting users opt-in seems like the 
best solution. But, it
+ degrades the default user-experience of ghostty on Ubuntu.  Alternative 
solutions are convoluted, 
+ need upstream support, and discussing them is beyond the scope of this SRU.
+ 
+ ---- End of SRU template ----
+ 
+ 
  Package: ghostty 1.3.0~us1-0ubuntu1
  Release: Ubuntu 26.04 LTS (resolute)
  
  The .desktop file and D-Bus activation service shipped by this package
  hardcode a shell-integration-features flag on the command line:
  
-   /usr/share/applications/com.mitchellh.ghostty.desktop:
-     Exec=/usr/bin/ghostty --gtk-single-instance=true 
--shell-integration-features=ssh-env
+   /usr/share/applications/com.mitchellh.ghostty.desktop:
+     Exec=/usr/bin/ghostty --gtk-single-instance=true 
--shell-integration-features=ssh-env
  
-   /usr/share/dbus-1/services/com.mitchellh.ghostty.service:
-     Exec=/usr/bin/ghostty --gtk-single-instance=true --initial-window=false 
--shell-integration-features=ssh-env
+   /usr/share/dbus-1/services/com.mitchellh.ghostty.service:
+     Exec=/usr/bin/ghostty --gtk-single-instance=true --initial-window=false 
--shell-integration-features=ssh-env
  
  In Ghostty, a CLI flag replaces the config file's value for that option
  entirely (values are deltas against built-in defaults, and sources are
  not merged). As a result, any shell-integration-features setting in the
  user's ~/.config/ghostty/config is silently ignored whenever Ghostty is
  launched from the desktop (app grid, dock, GNOME activities) — which is
  how virtually all users launch it. The same config works when running
  `ghostty` from another terminal, making the behavior confusingly
  inconsistent.
  
  Steps to reproduce:
  1. echo "shell-integration-features = no-cursor" >> ~/.config/ghostty/config
-    (any value reproduces it; no-cursor is just an easily observable one,
-    together with e.g. cursor-style = block)
+    (any value reproduces it; no-cursor is just an easily observable one,
+    together with e.g. cursor-style = block)
  2. Launch Ghostty from GNOME's app grid.
  3. In the new window: echo $GHOSTTY_SHELL_FEATURES
  
  Expected: the cursor feature is disabled, e.g.
-   GHOSTTY_SHELL_FEATURES=path,title
+   GHOSTTY_SHELL_FEATURES=path,title
  and the prompt cursor follows cursor-style.
  
  Actual:
-   GHOSTTY_SHELL_FEATURES=cursor:blink,path,ssh-env,title
+   GHOSTTY_SHELL_FEATURES=cursor:blink,path,ssh-env,title
  The user's no-cursor was discarded; the shell integration forces a bar
  cursor at every prompt, overriding cursor-style = block. Running
  `ghostty` manually from another terminal (no flag) honors the config.
  
  `ghostty +show-config` resolves the config correctly (no-cursor,...),
  which makes this hard to debug: the config appears valid and loaded,
  yet desktop-launched windows ignore it.
  
  Suggested fix: drop the flag from both Exec lines and document ssh-env
  as an opt-in setting for users. I verified this build offers no
  system-wide config mechanism (neither /etc/ghostty/config nor
  XDG_CONFIG_DIRS is read) that could carry a distro default at a
  precedence the user's config can override — so any Exec-line flag for
  this option unavoidably clobbers user configuration. If a distro
  default for ssh-env is genuinely desired, that needs a lower-precedence
  mechanism (system config support or merge semantics for this option),
  which would be an upstream feature request.
  
  Additional information:
  
-  * The flag is not present in upstream Ghostty's launcher templates at
-    the packaged version: dist/linux/app.desktop.in and
-    dist/linux/dbus.service.in at the v1.3.0 tag contain only
-    --gtk-single-instance=true (plus --initial-window=false for D-Bus).
-    The --shell-integration-features=ssh-env argument is therefore part
-    of the Ubuntu packaging delta.
+  * The flag is not present in upstream Ghostty's launcher templates at
+    the packaged version: dist/linux/app.desktop.in and
+    dist/linux/dbus.service.in at the v1.3.0 tag contain only
+    --gtk-single-instance=true (plus --initial-window=false for D-Bus).
+    The --shell-integration-features=ssh-env argument is therefore part
+    of the Ubuntu packaging delta.
  
-  * Users are already affected by this in the wild: upstream discussion
-    https://github.com/ghostty-org/ghostty/discussions/12766 reports the
-    identical symptom (no-cursor ignored when launched from the GNOME
-    activities overview, works from the command line) on Ubuntu 26.04
-    with this package. It remains unconfirmed upstream, presumably
-    because upstream's own files do not carry the flag.
+  * Users are already affected by this in the wild: upstream discussion
+    https://github.com/ghostty-org/ghostty/discussions/12766 reports the
+    identical symptom (no-cursor ignored when launched from the GNOME
+    activities overview, works from the command line) on Ubuntu 26.04
+    with this package. It remains unconfirmed upstream, presumably
+    because upstream's own files do not carry the flag.
  
  Workaround for affected users: strip the feature from
  GHOSTTY_SHELL_FEATURES in the shell rc file before the integration's
  deferred init reads it at the first prompt.

** Changed in: ghostty (Ubuntu Resolute)
       Status: New => In Progress

** Patch added: "ghostty_1.3.0~us1-0ubuntu1.2.debdiff"
   
https://bugs.launchpad.net/ubuntu/+source/ghostty/+bug/2160296/+attachment/6002066/+files/ghostty_1.3.0~us1-0ubuntu1.2.debdiff

** Summary changed:

- Desktop launcher passes --shell-integration-features=ssh-env, silently 
discarding the user's shell-integration-features config
+ [SRU] Desktop launcher passes --shell-integration-features=ssh-env, silently 
discarding the user's shell-integration-features config

** Description changed:

  [Impact]
  Hard-coding `--shell-integration-features=ssh-env` in ghostty's 
desktop-launcher ignored user-configuration.
  But launching ghostty from a terminal did not have this issue. This SRU 
removes the hard-coding, but
  retains the the `ssh-env` default, while letting the user-configuration merge 
with it. If the user-configuration
  includes `no-ssh-env`, the default is overridden.
  
  There are three goals here, and the SRU addresses [2] and [3]:
-   1. Maintaining a good default user-experience for ghostty.
-   2. Letting the user-configuration merge with, and override the defaults.
-   3. Uniformity in the way the desktop-launcher and command-line launching 
deal with user-configuration.
+   1. Maintaining a good default user-experience for ghostty.
+   2. Letting the user-configuration merge with, and override the defaults.
+   3. Uniformity in the way the desktop-launcher and command-line launching 
deal with user-configuration.
  
  [Test plan]
  The following behavior can be reproduced be ghostty package version 
1.3.0~us1-0ubuntu1.1 or before, on Ubuntu 26.04.
  
- 1. Add the following line to the ghostty config file: 
-    shell-integration-features = no-cursor
+ 1. Add the following line to the ghostty config file:
+    shell-integration-features = no-cursor
  
-    $ echo "shell-integration-features = no-cursor" >>
+    $ echo "shell-integration-features = no-cursor" >>
  ~/.config/ghostty/config.ghostty
  
  2. Next, close ghostty and reopen it using the desktop launcher. The blinking 
cursor is still seen. This means the user config
  of "no-cursor" was ignored. Also, $GHOSTTY_SHELL_FEATURES still contains 
'cursor-blink'.
  
-    $ echo $GHOSTTY_SHELL_FEATURES
-    cursor:blink,path,ssh-env,title
+    $ echo $GHOSTTY_SHELL_FEATURES
+    cursor:blink,path,ssh-env,title
  
  3. Now, launch another instance of ghostty from the command line. This 
launches with the expected block cursor. Also, GHOSTTY_SHELL_FEATURES
  has the expected values:
  
-    $ echo $GHOSTTY_SHELL_FEATURES
-    path,title
+    $ echo $GHOSTTY_SHELL_FEATURES
+    path,title
  
  This reveals the two reported issues:
  1. User configuration is ignored with the desktop launcher (from GNOME's app 
grid)
  2. The desktop launcher and launching ghostty through a CLI command handles 
user-configuration differently.
  
  Running 1-3, with the fix:
- Launching ghostty using either the desktop launcher, or command should show 
the expected block cursor. 
+ Launching ghostty using either the desktop launcher, or command should show 
the expected block cursor.
  And GHOSTTY_SHELL_FEATURES should show:
-    $ echo $GHOSTTY_SHELL_FEATURES
-    path,title
+    $ echo $GHOSTTY_SHELL_FEATURES
+    path,title
  
  [Where problems could occur]
  With this SRU, both ways of launching ghostty uniformly deal with 
shell-integration features in the user-configuration. We maintain
- the `ssh-env` default in both cases. However,`ssh-env` comes with 
consequences which were only seen with the desktop-launcher, prior to this 
change. 
- They will now be extended to command-line launching. This may cause 
regressions among users that launch ghostty through a command,
+ the `ssh-env` default in both cases. However,`ssh-env` comes with 
consequences which were only seen with the desktop-launcher, prior to this 
change. They will now be extended to command-line launching. This may cause 
regressions among users that launch ghostty through a command,
  which is unlikely to be as common as using the desktop-launcher.
  
  The next section details the rationale of adopting `ssh-env`, its
  drawbacks and other challenges.
  
  [Other info]
  We are now talking about the need for `ssh-env` and its drawbacks, which are 
technically beyond the scope of this SRU.
  
  > Why does the ghostty package have `shell-integration-features=ssh-env` by 
default?
  As debian/patches/default-shell-integration-ssh-env.patch describes, Ghostty 
propagates TERM=xterm-ghostty
  while ssh'ing to remote hosts. Even if a remote host has the latest 
`ncurses-term` installed it may only
  recognize TERM=ghostty. Not recognizing TERM means programs cannot lookup 
terminal features; the terminal
  experience severely degrades. Ghostty's `shell-integration-features=ssh-env` 
effectively sets TERM=xterm-256color
  on the remote host, working around the issue of not recognizing $TERM.
  
  > What are the consequences of `shell-integration-features=ssh-env`?
  The default `ssh-env` comes with the following consequences, but maybe only 
for the advanced user:
  1. Setting `shell-integration-features=ssh-env` installs an ssh() bash 
wrapper function. See [1].
  This will silently replace a user's ssh() if they have one defined.
- 2. Even if a user does not define their ssh() but passes ssh options using 
-o, those options are overridden. 
+ 2. Even if a user does not define their ssh() but passes ssh options using 
-o, those options are overridden.
  
  Such a user may choose to disable `ssh-env` in their user-configuration,
  which should be honored as a result of this SRU.
  
  > Does this situation have a solution better than `ssh-env`?
  Dropping `ssh-env` from the defaults and letting users opt-in seems like the 
best solution. But, it
- degrades the default user-experience of ghostty on Ubuntu.  Alternative 
solutions are convoluted, 
+ degrades the default user-experience of ghostty on Ubuntu.  Alternative 
solutions are convoluted,
  need upstream support, and discussing them is beyond the scope of this SRU.
  
  ---- End of SRU template ----
- 
  
  Package: ghostty 1.3.0~us1-0ubuntu1
  Release: Ubuntu 26.04 LTS (resolute)
  
  The .desktop file and D-Bus activation service shipped by this package
  hardcode a shell-integration-features flag on the command line:
  
    /usr/share/applications/com.mitchellh.ghostty.desktop:
      Exec=/usr/bin/ghostty --gtk-single-instance=true 
--shell-integration-features=ssh-env
  
    /usr/share/dbus-1/services/com.mitchellh.ghostty.service:
      Exec=/usr/bin/ghostty --gtk-single-instance=true --initial-window=false 
--shell-integration-features=ssh-env
  
  In Ghostty, a CLI flag replaces the config file's value for that option
  entirely (values are deltas against built-in defaults, and sources are
  not merged). As a result, any shell-integration-features setting in the
  user's ~/.config/ghostty/config is silently ignored whenever Ghostty is
  launched from the desktop (app grid, dock, GNOME activities) — which is
  how virtually all users launch it. The same config works when running
  `ghostty` from another terminal, making the behavior confusingly
  inconsistent.
  
  Steps to reproduce:
  1. echo "shell-integration-features = no-cursor" >> ~/.config/ghostty/config
     (any value reproduces it; no-cursor is just an easily observable one,
     together with e.g. cursor-style = block)
  2. Launch Ghostty from GNOME's app grid.
  3. In the new window: echo $GHOSTTY_SHELL_FEATURES
  
  Expected: the cursor feature is disabled, e.g.
    GHOSTTY_SHELL_FEATURES=path,title
  and the prompt cursor follows cursor-style.
  
  Actual:
    GHOSTTY_SHELL_FEATURES=cursor:blink,path,ssh-env,title
  The user's no-cursor was discarded; the shell integration forces a bar
  cursor at every prompt, overriding cursor-style = block. Running
  `ghostty` manually from another terminal (no flag) honors the config.
  
  `ghostty +show-config` resolves the config correctly (no-cursor,...),
  which makes this hard to debug: the config appears valid and loaded,
  yet desktop-launched windows ignore it.
  
  Suggested fix: drop the flag from both Exec lines and document ssh-env
  as an opt-in setting for users. I verified this build offers no
  system-wide config mechanism (neither /etc/ghostty/config nor
  XDG_CONFIG_DIRS is read) that could carry a distro default at a
  precedence the user's config can override — so any Exec-line flag for
  this option unavoidably clobbers user configuration. If a distro
  default for ssh-env is genuinely desired, that needs a lower-precedence
  mechanism (system config support or merge semantics for this option),
  which would be an upstream feature request.
  
  Additional information:
  
   * The flag is not present in upstream Ghostty's launcher templates at
     the packaged version: dist/linux/app.desktop.in and
     dist/linux/dbus.service.in at the v1.3.0 tag contain only
     --gtk-single-instance=true (plus --initial-window=false for D-Bus).
     The --shell-integration-features=ssh-env argument is therefore part
     of the Ubuntu packaging delta.
  
   * Users are already affected by this in the wild: upstream discussion
     https://github.com/ghostty-org/ghostty/discussions/12766 reports the
     identical symptom (no-cursor ignored when launched from the GNOME
     activities overview, works from the command line) on Ubuntu 26.04
     with this package. It remains unconfirmed upstream, presumably
     because upstream's own files do not carry the flag.
  
  Workaround for affected users: strip the feature from
  GHOSTTY_SHELL_FEATURES in the shell rc file before the integration's
  deferred init reads it at the first prompt.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2160296

Title:
  [SRU] Desktop launcher passes --shell-integration-features=ssh-env,
  silently discarding the user's shell-integration-features config

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ghostty/+bug/2160296/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to