terminal
terminal copied to clipboard
Setting io.elementary.terminal.settings.shell with dconf to a value crashes Gala
What Happened?
I tried searching for similar issues in the issue tracker, and discovered only #703 that seemed even remotely relevant, which discusses using a "login shell" e.g., having the shell that Terminal runs be /bin/bash --login or similar, so that the .profile is read for each new terminal.
Doing this with, for example, dconf-editor, causes Terminal to load an empty tab, which, when closed, crashes the whole windowing system and logs you out.
Steps to Reproduce
- run
dconf write io/elementary/terminal/settings/shell "'/usr/bin/bash -l'"or usedconf-editorto perform the same change - run Terminal; note that the tab title is a single
-, but no shell loads in the content area of the window - close this tab
- Gala crashes and restarts, taking open apps with it; if you repeat the steps above, Gala will crash, then display a "sad Mac"-type dialog that tells you you need to log out, and the only option is "OK"
So far, this is repeatable across multiple login sessions, and with a fresh Horus VM (7.1, with all .deb and Flatpak updates applied).
Expected Behavior
The dconf setting causes Terminal to run a login shell (i.e. reading ~/.profile), similar to how many other terminal emulators have a "Run as login shell" checkbox in their settings.
To be clear, I'm perfectly fine with there being no UI (except for dconf) for this. But the dconf setting is present and documented, so the expectation I had as a user is that it's a "supported" behavior for Terminal.
OS Version
7.1 (Horus)
Session Type
Classic Session (X11, This is the default)
Software Version
Older release (I have not run all updates)
Log Output
(forthcoming)
Hardware Info
Mid-2015 MacBook Air, but this has been tested on different hardware and in a VM, so not hardware-related.
To preempt a couple of questions by the maintainers / community:
- ~~I need to do work on this system right now, and don't want to crash everything again on purpose, but I will test with a clean elementary 7/8 install, with all updates applied~~
- same result in a fresh elementary OS 7.1 VM, with all updates
- ~~yes, I will run Terminal from an xterm or something, to capture debugging output~~
$ io.elementary.terminal # just running from xterm and closing w/ window controls ** (io.elementary.terminal:598128): WARNING **: 12:39:45.371: TerminalWidget.vala:713: Failed to execute child process “/usr/bin/bash -l”: Failed to execve: No such file or directory (io.elementary.terminal:598128): VTE-CRITICAL **: 12:39:54.640: int vte_pty_get_fd(VtePty*): assertion 'VTE_IS_PTY(pty)' failed - I will try some other values for
io.elementary.terminal.settings.shell - I'll have a look at the source to see if I can figure what's going on, before reporting back
A quick look at the code indicates that it does not properly handle arguments given in the shell setting ( expects only the path of the shell) but whether this is enough to cause a crash is questionable. I'll investigate in a VM.
Oddly enough, running Terminal inside an xterm does not crash XorgGala, and you get the standard warning about closing a tab with a running process.
xkilling the Terminal window or killing the process by PID also prevents Gala from crashing, so there's a weird tie-in with the window manager with this one.