Skip to content

feat: add "Restore macOS Terminal as Default" functionality#9971

Open
jiakeboge wants to merge 6 commits into
warpdotdev:masterfrom
jiakeboge:feature/unset-default-terminal
Open

feat: add "Restore macOS Terminal as Default" functionality#9971
jiakeboge wants to merge 6 commits into
warpdotdev:masterfrom
jiakeboge:feature/unset-default-terminal

Conversation

@jiakeboge

@jiakeboge jiakeboge commented May 3, 2026

Copy link
Copy Markdown

Description

This PR implements the functionality to restore the default terminal handler from Warp back to the macOS system Terminal (com.apple.Terminal). Currently, setting Warp as the default terminal is effectively a one-way operation from within Warp.

Closes #10007

The implementation includes:

  • A new macOS-specific function to restore the default role handler to Terminal.app.
  • A dynamic app menu item that toggles between "Set Warp as Default Terminal" and "Restore macOS Terminal as Default" based on the current state.

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Screenshots or a short video of the implementation are included below.

Screenshots / Videos

Screen capture demonstrating the end-to-end flow:

switch.default.terminal.mov

Testing

  • Manual Testing: Tested locally on macOS with the PR branch. Verified that selecting "Set Warp as Default Terminal" from the app menu changes the Launch Services handler to dev.warp.WarpOss, and selecting "Restore macOS Terminal as Default" changes the handler back to com.apple.Terminal.
  • Manual Verification Command: Verified the handler with:
    /usr/bin/swift -e 'import Foundation; import CoreServices; let uti = "public.unix-executable" as NSString; if let handler = LSCopyDefaultRoleHandlerForContentType(uti, LSRolesMask(rawValue: 0x00000008)) { print(handler.takeRetainedValue() as String) } else { print("<none>") }'
  • Unit Testing: Updated the DefaultTerminal model to ensure the is_warp_default state is correctly updated when the restore action is triggered.
  • Cross-platform: Verified that the logic correctly falls back to "Not implemented" on non-macOS platforms.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Changelog Entries for Stable

CHANGELOG-IMPROVEMENT: Added the ability to restore the macOS system Terminal as the default terminal from the Warp menu.

jiakeboge added 2 commits May 3, 2026 18:38
This change allows users to revert the default terminal setting back to
the macOS system Terminal (com.apple.Terminal).
- Added `unset_warp_as_default_terminal` to macOS platform implementation.
- Updated `DefaultTerminal` model to support unsetting the default status.
- Modified the app menu to dynamically toggle between "Set" and "Unset" labels.
- Enabled unsetting the default terminal from the Features settings page.
 - Added `unset_warp_as_default_terminal` to revert to Terminal.app.
 - Updated menu item label to "Restore macOS Terminal as Default" when Warp is the current default.
 - Added a corresponding link in the Features settings page for better discoverability.
@cla-bot

cla-bot Bot commented May 3, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @jiakeboge on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 3, 2026
@oz-for-oss

oz-for-oss Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

@jiakeboge

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @lucieleblanc.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR adds a macOS restore path for the default terminal handler, updates the app menu to toggle between setting Warp and restoring Terminal.app, and adds a matching settings-page action.

Concerns

No important correctness or security concerns were identified in the changed diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot requested a review from lucieleblanc May 3, 2026 11:08

@lucieleblanc lucieleblanc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the PR! The overall approach makes sense to me. Instead of trying to restore whatever the previous default terminal app was, restoring the default MacOS Terminal.app is simpler.

A couple of changes to make before we enable CI:

  • Lename the new events, enum variants, functions, etc. to use the "restore" wording instead of the "unset" wording. "Restore" is the more accurate terminology.
  • Include a screen recording in the PR description that demonstrates this feature working end to end.
  • Make sure to sign the CLA (see bot comment above).

Comment thread app/src/default_terminal/mod.rs Outdated
}
}

pub fn unset_warp_default(&mut self, ctx: &mut ModelContext<Self>) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This isn't really "unset" -- it resets to the native terminal app. Could we rename this to "restore_macos_terminal_as_default" or something of the like?

Comment thread app/src/default_terminal/mac.rs Outdated
set_default_terminal(&bundle_id)
}

pub fn unset_warp_as_default_terminal() -> Result<(), String> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here: please rename identifiers to use the "restore" wording instead of the "unset" wording.

@jiakeboge

Copy link
Copy Markdown
Author

Thank you for the PR! The overall approach makes sense to me. Instead of trying to restore whatever the previous default terminal app was, restoring the default MacOS Terminal.app is simpler.

A couple of changes to make before we enable CI:

  • Lename the new events, enum variants, functions, etc. to use the "restore" wording instead of the "unset" wording. "Restore" is the more accurate terminology.
  • Include a screen recording in the PR description that demonstrates this feature working end to end.
  • Make sure to sign the CLA (see bot comment above).

WIP

@jiakeboge jiakeboge closed this May 9, 2026
@jiakeboge jiakeboge reopened this May 9, 2026
@oz-for-oss

oz-for-oss Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

@jiakeboge

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

oz-for-oss[bot]
oz-for-oss Bot previously requested changes May 9, 2026

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR adds a macOS restore path for the default terminal setting and wires it into the app menu and Features settings page.

Concerns

  • ⚠️ The change is user-visible, but the PR description's Screenshots / Videos section only contains placeholder bullets and no attached screenshot or screen recording. Manual testing evidence is required for changes that can be manually tested; please attach screenshots or a screen recording showing the menu toggle and settings link end to end, or justify why visual evidence is not possible.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Renamed internal identifiers, functions, and enum variants from 'unset'
to 'restore' to better reflect the action of reverting the default
terminal back to Terminal.app. This addresses feedback from the PR
review to use more accurate terminology, consistent with recent
UI label changes.

- Renamed `unset_warp_default` to `restore_macos_terminal_as_default`.
- Updated `UnsetWarpDefaultTerminal` to `RestoreMacOSTerminalAsDefault`.
- Updated associated telemetry and UI event handlers.
@cla-bot cla-bot Bot added the cla-signed label May 9, 2026
@jiakeboge

Copy link
Copy Markdown
Author

/oz-review

@oz-for-oss

oz-for-oss Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

@jiakeboge

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@jiakeboge

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot

cla-bot Bot commented May 9, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

oz-for-oss[bot]
oz-for-oss Bot previously requested changes May 9, 2026

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR adds controls to restore macOS Terminal as the default shell handler from the app menu and Features settings page.

Concerns

  • app/src/settings_view/features_page.rs contains stray trailing tokens after the final GraphicsBackendWidget implementation, which should make the Rust source fail to compile.
  • Manual testing evidence is missing for a user-visible menu/settings change. The PR description only contains placeholder entries ([Menu Bar Toggle Demonstration], [Settings Page Link Update]) rather than screenshots or a screen recording showing the change end to end.

Verdict

Found: 1 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/settings_view/features_page.rs Outdated
col.finish()
}
}
nish()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚨 [CRITICAL] This stray token block leaves features_page.rs syntactically invalid, so the app will not compile. Remove the extra lines after the GraphicsBackendWidget impl.

Fixed a syntax error at the end of features_page.rs caused by stray
'nish()' tokens. Also verified all 'unset' references are removed in
favor of 'restore' terminology per reviewer request.
@jiakeboge

Copy link
Copy Markdown
Author

/oz-review

@oz-for-oss

oz-for-oss Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

@jiakeboge

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @lucieleblanc.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot dismissed stale reviews from themself May 9, 2026 03:30

Oz no longer requests changes for this pull request after the latest automated review.

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR adds a macOS restore path for resetting the default terminal handler to Terminal.app and updates the menu/settings entry points to dispatch that action.

Concerns

  • No blocking correctness or security concerns found in the annotated diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot requested a review from lucieleblanc May 9, 2026 03:30

@lucieleblanc lucieleblanc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @jiakeboge , thank you for the changes. I still don't see a screen capture in the PR description. For faster review, please include a screen recording of this feature in action: setting Warp as the default terminal, showing that setting reflected in native MacOS surfaces, restoring the native MacOS terminal, and showing that setting reflected once more.

On MacOS, you can use cmd-shift-5 to start a screen recording.

Feel free to comment or re-request review when it's done and I'll approve and merge this.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Hi @jiakeboge — final reminder: a reviewer requested changes on this PR and it has been inactive for 27 days. It will be automatically closed in about 3 day(s) unless you push updates or reply. Maintainers can apply the no-autoclose label to keep it open.

@jiakeboge

Copy link
Copy Markdown
Author

Hi @jiakeboge — final reminder: a reviewer requested changes on this PR and it has been inactive for 27 days. It will be automatically closed in about 3 day(s) unless you push updates or reply. Maintainers can apply the no-autoclose label to keep it open.

THX, I'll handle this.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @jiakeboge — a reviewer requested changes on this PR and it hasn't had activity from you in 7 days. When you get a chance, please push updates or reply to the review so a reviewer can take another look. Without activity, this PR will be automatically closed after 14 days of inactivity.

@jiakeboge

jiakeboge commented Jun 16, 2026

Copy link
Copy Markdown
Author

Hi @jiakeboge — a reviewer requested changes on this PR and it hasn't had activity from you in 7 days. When you get a chance, please push updates or reply to the review so a reviewer can take another look. Without activity, this PR will be automatically closed after 14 days of inactivity.

Thank you for reminding me.

@cla-bot

cla-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: bot.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot cla-bot Bot removed the cla-signed label Jun 22, 2026
@jiakeboge

Copy link
Copy Markdown
Author
switch.default.terminal.mov

Manual Verification

Tested locally on macOS with the PR branch.

Commands run:

PATH="$HOME/.cargo/bin:/opt/homebrew/bin:$PATH" ./script/run --dont-open
open target/debug/bundle/osx/WarpOss.app

Verified the Launch Services handler with:

/usr/bin/swift -e 'import Foundation; import CoreServices; let uti = "public.unix-executable" as NSString; if let handler =
LSCopyDefaultRoleHandlerForContentType(uti, LSRolesMask(rawValue: 0x00000008)) { print(handler.takeRetainedValue() as String) }
else { print("<none>") }'

Results:

- After selecting Set Warp as Default Terminal from the app menu, the handler changed to dev.warp.WarpOss.
- After selecting Restore macOS Terminal as Default from the app menu, the handler changed back to com.apple.Terminal.

Also verified that the Settings > Features default terminal action is no longer shown, and the app menu remains the only UI entry
point for this action.

@jiakeboge jiakeboge force-pushed the feature/unset-default-terminal branch from 82ac6c3 to 32b21ab Compare June 22, 2026 03:34
@cla-bot cla-bot Bot added the cla-signed label Jun 22, 2026
@jiakeboge jiakeboge requested a review from lucieleblanc June 22, 2026 08:14
@github-actions

Copy link
Copy Markdown
Contributor

Hi @jiakeboge — a reviewer requested changes on this PR and it hasn't had activity from you in 7 days. When you get a chance, please push updates or reply to the review so a reviewer can take another look. Without activity, this PR will be automatically closed after 14 days of inactivity.

@jiakeboge

Copy link
Copy Markdown
Author

Hi @lucieleblanc, I moved the requested screen capture into the PR description and updated the manual verification notes there as well. Could you take another look when you get a chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add 'Restore macOS Terminal as Default' functionality

2 participants