pingdotgg / pingdotgg/t3code

[Bug]: t3code --version segfaults without a display instead of printing the version

Open
#5,474 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

Before submitting
  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.
Area

apps/desktop

Steps to reproduce
  1. Install the Linux desktop app (tested with the Arch t3code-bin 0.0.31 package, which repackages the official AppImage).
  2. From an environment without a usable X/Wayland display (SSH session, script, CI, or just env -u DISPLAY -u WAYLAND_DISPLAY), run:
env -u DISPLAY -u WAYLAND_DISPLAY t3code --version
Expected behavior

--version prints the app version and exits 0 without needing a display, like most CLIs. This matters for packaging scripts, update checks, and headless automation that shell out to --version.

Actual behavior

The app initializes the GUI platform before handling --version, fails, and dies with SIGSEGV (exit code 139):

[ERROR:ui/ozone/platform/x11/ozone_platform_x11.cc:256] Missing X server or $DISPLAY
[ERROR:ui/aura/env.cc:246] The platform failed to initialize.  Exiting.
Segmentation fault (core dumped)

Extra data point: with --no-sandbox the same errors print but the process exits 0 instead of segfaulting — so the SIGSEGV itself seems to happen in the sandboxed teardown path after the platform init failure. Either way, no version string is ever printed.

Impact

Minor bug or occasional failure

Version or commit

0.0.31 (Arch t3code-bin 0.0.31-1)

Environment

Arch Linux (CachyOS), kernel 7.1.1-2-cachyos, X11 (KDE Plasma)

Logs or stack traces
$ env -u DISPLAY -u WAYLAND_DISPLAY /opt/t3code-bin/t3code --version; echo "exit=$?"
[3074395:0806/080653.622599:ERROR:ui/ozone/platform/x11/ozone_platform_x11.cc:256] Missing X server or $DISPLAY
[3074395:0806/080653.622631:ERROR:ui/aura/env.cc:246] The platform failed to initialize.  Exiting.
exit=139

$ /opt/t3code-bin/t3code --no-sandbox --version; echo "exit=$?"
[3077141:0806/080834.287894:ERROR:ui/ozone/platform/x11/ozone_platform_x11.cc:256] Missing X server or $DISPLAY
[3077141:0806/080834.287933:ERROR:ui/aura/env.cc:246] The platform failed to initialize.  Exiting.
exit=0
Workaround

Read the version from packaging metadata instead (pacman -Qi t3code-bin), or handle --version/-v in the Electron main process before app.whenReady() (e.g. check process.argv and console.log(app.getVersion()); app.exit(0) early).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the apps/desktop Electron main process and inspect how process.argv is handled relative to app.whenReady(). Reproduce with env -u DISPLAY -u WAYLAND_DISPLAY t3code --version and verify that the version prints, exits 0, and does not initialize the GUI or segfault.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
cli, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.