Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "start terminal" command to right-click context menu #2787

Open
HeavenVolkoff opened this issue Oct 24, 2024 Discussed in #2759 · 3 comments
Open

Add "start terminal" command to right-click context menu #2787

HeavenVolkoff opened this issue Oct 24, 2024 Discussed in #2759 · 3 comments
Labels
app/desktop good first issue Good for newcomers kind/feature A new feature

Comments

@HeavenVolkoff
Copy link
Member

Discussed in #2759

Originally posted by capaj October 11, 2024
Context menu when I click on empty space currently has these two options:

image

would be nice if it had option to start a terminal session in that folder

Implementation

Frontend

Implement a open_terminal function in Plataform with an attached command in command.ts.

Web plataforms should ignore this, due to the complexity of adding a remote terminal to web being out of scope for this issue.

Extra feature (future): Add a settings entry that allows overriding the default terminal

Backend

Implement a open_terminal function in file.rs that checks each OS's default Terminal app:

For macOS we can look at iTerm code to check how it reads/sets the default macOS terminal, and fallback to terminal.app if that fails:
https://github.com/gnachman/iTerm2/blob/v3.5.5/sources/iTermLaunchServices.m#L212-L246

For Windows we can look at Microsoft Terminal code to check how it reads/sets the default Windows terminal, and fallback to Powershell if that fails or to CMD.exe as last case resort:
https://github.com/microsoft/terminal/blob/v1.22.2912.0/src/propslib/DelegationConfig.cpp#L158-L213

For linux there are a couple of ways for configuring the default terminal:

  • Look into the $TERMINAL envvar
  • For debian based distros run: update-alternatives --query x-terminal-emulator
  • For XDG complient DEs check the handler for x-scheme-handler/terminal mime
  • For DE specific configurations, see xdg-terminal implementation
  • Fallback to a list of default terminals: gnome-terminal konsole xfce4-terminal xterm urxvt lxterminal mate-terminal
Copy link

linear bot commented Oct 24, 2024

@linear linear bot removed the core label Oct 24, 2024
@moudgalya1223
Copy link

hello @HeavenVolkoff can i work on this

@HeavenVolkoff
Copy link
Member Author

@moudgalya1223 sure, feel free to work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app/desktop good first issue Good for newcomers kind/feature A new feature
Projects
None yet
Development

No branches or pull requests

2 participants