Skip to content

Recognize .command files as shell scripts#9345

Open
anshul-garg27 wants to merge 1 commit intowarpdotdev:masterfrom
anshul-garg27:fix/9213-command-extension
Open

Recognize .command files as shell scripts#9345
anshul-garg27 wants to merge 1 commit intowarpdotdev:masterfrom
anshul-garg27:fix/9213-command-extension

Conversation

@anshul-garg27
Copy link
Copy Markdown

Description

Fixes #9213. On macOS, .command is the standard extension for double-clickable shell scripts (a #!/usr/bin/env bash file you can chmod +x and run from Finder). Opening one in Warp's editor today shows "Language support is unavailable for this file type" because language_by_filename in crates/languages/src/lib.rs doesn't include command next to the existing sh | zsh | bash shell extensions.

-        "sh" | "zsh" | "bash" => language_by_name("shell"),
+        "sh" | "zsh" | "bash" | "command" => language_by_name("shell"),

Testing

  • Added command_extension_resolves_to_shell in crates/languages/src/lib_tests.rs that calls language_by_filename(Path::new("script.command")) and asserts the returned language's display_name is "Shell" — fails on master, passes after the fix.
  • cargo fmt -p languages -- --check passes locally.
  • Couldn't run cargo nextest run -p languages locally because the Metal toolchain isn't installed (same situation as Expand ~ in warp://action/new_tab?path= URLs #9277), so relying on CI for the full clippy / nextest pass.

Changelog Entries for Stable

CHANGELOG-BUG-FIX: .command shell scripts now open with shell syntax highlighting in Warp's editor.

@cla-bot cla-bot Bot added the cla-signed label Apr 29, 2026
@anshul-garg27 anshul-garg27 mentioned this pull request Apr 29, 2026
4 tasks
@oz-for-oss
Copy link
Copy Markdown

oz-for-oss Bot commented Apr 29, 2026

@anshul-garg27

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

You can follow along in the session on Warp.

I approved this pull request and requested human review from: @vorporeal, @alokedesai, @zachbai.

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

I approved this pull request. No matching stakeholder was found for the changed files, so no human reviewers were requested.

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

Powered by Oz

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Overview

This PR maps .command files to the existing shell language support and adds a focused regression test for filename-based detection.

Concerns

  • None identified.

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

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Overview

This PR updates the language extension mapping so .command files resolve to the existing Shell language support, and adds a focused regression test for language_by_filename(Path::new("script.command")).

Concerns

  • No blocking correctness or security concerns found in the changed lines.

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error opening .command file

1 participant