spacedriveapp / spacedrive

Spacedrive is an open source cross-platform file explorer, powered by a virtual distributed filesystem written in Rust.
https://spacedrive.com
GNU Affero General Public License v3.0
32.23k stars 946 forks source link

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

Open HeavenVolkoff opened 4 hours ago

HeavenVolkoff commented 4 hours ago

Discussed in https://github.com/spacedriveapp/spacedrive/discussions/2759

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:

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:

linear[bot] commented 4 hours ago

ENG-1945 Add "start terminal" command to right-click context menu