Skip to content

Detect and launch Linux terminal emulators and respect $TERMINAL#35

Merged
AmrDab merged 1 commit intoLinux/Arm64-Bug-Fixfrom
codex/review-pr-34-and-address-issues
Mar 7, 2026
Merged

Detect and launch Linux terminal emulators and respect $TERMINAL#35
AmrDab merged 1 commit intoLinux/Arm64-Bug-Fixfrom
codex/review-pr-34-and-address-issues

Conversation

@AmrDab
Copy link
Owner

@AmrDab AmrDab commented Mar 7, 2026

Motivation

  • Improve behavior when opening the interactive task console on Linux by detecting available terminal emulators and honoring the user's TERMINAL environment variable.
  • Provide a graceful fallback to run the interactive script in the current shell when no external terminal is available.

Description

  • Added parseCommandLine to parse simple quoted command lines from TERMINAL and a LinuxTerminalLauncher type.
  • Implemented findLinuxTerminal which resolves executables from PATH, validates they are executable, supports TERMINAL with arguments, and probes common terminal candidates (x-terminal-emulator, gnome-terminal, konsole, xfce4-terminal, xterm).
  • Updated the start command to use the detected terminal to spawn the interactive task script with the appropriate launcher arguments, and to fall back to running the script in the current terminal with a warning when no terminal emulator is found.
  • Added robust executable resolution (resolveExecutable) and executable checks (fs.accessSync with X_OK) to avoid spawning non-existent commands.

Testing

  • Ran TypeScript type-checking with tsc --noEmit which completed successfully.
  • Ran the project build and existing automated test suite with npm test, and all tests passed successfully.

Codex Task

@AmrDab AmrDab merged commit 134bf86 into Linux/Arm64-Bug-Fix Mar 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant