Skip to content

Fix: Prevent unnecessary terminal spawning and respect TERMINAL env var#157

Open
Obsidian-Jackal wants to merge 1 commit intoCachyOS:developfrom
Obsidian-Jackal:fix/prevent-unnecessary-terminal-spawning
Open

Fix: Prevent unnecessary terminal spawning and respect TERMINAL env var#157
Obsidian-Jackal wants to merge 1 commit intoCachyOS:developfrom
Obsidian-Jackal:fix/prevent-unnecessary-terminal-spawning

Conversation

@Obsidian-Jackal
Copy link

  • Modified terminal-helper to check $TERMINAL and x-terminal-emulator first
  • Updated rootshell.sh to execute commands directly without spawning terminals
  • Modified gui.rs to detect simple systemctl commands and run them without terminals
  • Added comment to utils.rs clarifying pkexec behavior

This fixes issues where authentication dialogs and simple operations like enabling/disabling systemd services were spawning unnecessary terminal windows. The changes ensure user terminal preferences are respected while preventing terminal spawning for operations that don't require user interaction.

- Modified terminal-helper to check $TERMINAL and x-terminal-emulator first
- Updated rootshell.sh to execute commands directly without spawning terminals
- Modified gui.rs to detect simple systemctl commands and run them without terminals
- Added comment to utils.rs clarifying pkexec behavior

This fixes issues where authentication dialogs and simple operations like
enabling/disabling systemd services were spawning unnecessary terminal windows.
The changes ensure user terminal preferences are respected while preventing
terminal spawning for operations that don't require user interaction.

if is_simple_command {
// Run directly without spawning a terminal window
return utils::run_cmd(command.to_string(), escalate).map(|s| s.success()).unwrap_or(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as of now it shouldn't spawn terminal window as it's using run_cmd

it also shouldn't spawn unnecessary auth prompts for systemctl operations as its handled by systemd already

Copy link
Author

@Obsidian-Jackal Obsidian-Jackal Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not how the original flow of the code handled it. Are you sure you thoroughly tested how it was originally, before you made that comment?

Copy link
Member

@vnepogodin vnepogodin Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, wasn't able to reproduce it either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants