Skip to content

fix(shell-sync): remove interactive shell mode and reduce security false positives - #2403

Open
VitalyMarom wants to merge 6 commits into
freelensapp:mainfrom
VitalyMarom:main
Open

VitalyMarom wants to merge 6 commits into
freelensapp:mainfrom
VitalyMarom:main

Conversation

@VitalyMarom

Copy link
Copy Markdown

Summary

This PR removes the explicit -i (interactive) argument when spawning Fish-like shells during shell environment detection.

Related Issues:

#2377
#2376

Motivation

The interactive flag is not required for environment computation when the shell is already started as a login shell (-l).
Using an interactive shell for environment discovery may also trigger security monitoring and endpoint protection tools. Some EDR and security products can flag this behavior as suspicious shell-spawning activity or reverse shell-like behavior, resulting in false-positive security alerts.
Additionally, shell environment variables intended for GUI applications should generally be configured in login shell initialization files. For example, in Zsh the recommended location is: ~/.zprofile

Since .zprofile is evaluated by login shells, running an additional interactive shell should not be necessary for environment synchronization.

Changes

  • Removed the Fish-specific -i argument.
  • Removed the associated command modification used for interactive shell execution.
  • Updated unit tests to expect: ["-l"] instead of ["-l", "-i"]

Benefits

  • Reduces the likelihood of triggering security-tool false positives.
  • Avoids unnecessary interactive shell execution.
  • Aligns environment detection with standard login-shell behavior.
  • Encourages use of login-shell configuration files such as .zprofile for environment variables.
  • Simplifies shell-specific logic.

Testing

Updated the existing test to verify that Fish-like shells are spawned with: ["-l"] and confirmed that environment detection continues to work as expected.

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.

1 participant