Skip to content

Conversation

peaklabs-dev
Copy link
Contributor

@peaklabs-dev peaklabs-dev commented Aug 5, 2025

ToDo & Limitations

  • Limitation: Currently, this change only works for macOS because the app names are specific to macOS. I am not 100% sure how we would make this change cross platform as app names could be different on windows.
  • ToDo: Instead of using links to open all the code editors (like now), we could refactor that part of the code to open via app names as well using one clean function. This would be helpful because once every default terminal and code editor is opened via the app name, we could allow custom apps we do not have in the list as well. To add a custom app the users could select an app from the app folder, which would be very useful because we would not have to add every editor and the user can just select one. Good idea??

🧢 Changes

  • feat(ui): add default terminal settings to the General settings page
  • feat(core): add Open in Terminal to project menu which opens the current project in the default terminal

Preview

Settings

image

Menu

image

Copy link

vercel bot commented Aug 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Comments Updated (UTC)
gitbutler-components Ready Preview Comment Aug 12, 2025 10:12am

Copy link

vercel bot commented Aug 5, 2025

@peaklabs-dev is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added rust Pull requests that update Rust code @gitbutler/desktop labels Aug 5, 2025
@peaklabs-dev peaklabs-dev changed the title feat: add Default Terminal setting & Open in Terminal menu feat: add Default terminal setting & Open in Terminal menu Aug 5, 2025
@peaklabs-dev peaklabs-dev marked this pull request as ready for review August 5, 2025 15:22
@PavelLaptev
Copy link
Contributor

@peaklabs-dev thank you for the PR :-)
I made a small commit. I moved "default terminal" and "default editor" into a single group because they both relate to default tools.

image

@peaklabs-dev peaklabs-dev changed the title feat: add Default terminal setting & Open in Terminal menu feat: add Default terminal setting & Open in terminal menu Aug 6, 2025
@peaklabs-dev peaklabs-dev marked this pull request as draft August 7, 2025 21:49
@PavelLaptev
Copy link
Contributor

@peaklabs-dev Is this still something we want to merge right?

@peaklabs-dev
Copy link
Contributor Author

@PavelLaptev Yes, but I'm not sure how to implement this for Linux and Windows. Also, should we switch to opening the app for code editors as well instead of links, to allow custom app selection?

#[cfg(target_os = "macos")]
{
use std::process::Command;
Command::new("open")
Copy link
Collaborator

Choose a reason for hiding this comment

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

If open::with_command(…) would be used instead, I think this would be portable provided viable app-names. The .app suffix on MacOS also wouldn't be needed then, I think

Generally I think it would be OK to start supporting MacOS and add Windows/Linux later. This probably would be gated where the available app-names are configured.

@PavelLaptev
Copy link
Contributor

@PavelLaptev Yes, but I'm not sure how to implement this for Linux and Windows.

I see. Yes, it would be nice to handle it for all platforms.

should we switch to opening the app for code editors as well instead of links, to allow custom app selection?

What do you mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@gitbutler/desktop rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants