Originally posted by **capaj** October 11, 2024
Context menu when I click on empty space currently has these two options:
![image](https://github.com/user-attachments/assets/1b308c4b-60ea-4d6d-83b4-2b2464b59132)
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:
Discussed in https://github.com/spacedriveapp/spacedrive/discussions/2759
Implementation
Frontend
Implement a
open_terminal
function inPlataform
with an attached command incommand.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 infile.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-L246For 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:
update-alternatives --query x-terminal-emulator
x-scheme-handler/terminal
mimegnome-terminal konsole xfce4-terminal xterm urxvt lxterminal mate-terminal