Skip to content

Add bootcommand mappings for left/right command and option keys#293

Merged
tanmay-hc merged 2 commits into
hashicorp:mainfrom
torarnv:add-command-option-bootcommand-keys
May 25, 2026
Merged

Add bootcommand mappings for left/right command and option keys#293
tanmay-hc merged 2 commits into
hashicorp:mainfrom
torarnv:add-command-option-bootcommand-keys

Conversation

@torarnv
Copy link
Copy Markdown
Contributor

@torarnv torarnv commented May 29, 2025

When automating macOS systems it's convenient to refer to the keys by their natural names, and for the VNC driver none of the existing special keys mapped to option, so this enables boot commands using the option key.

@torarnv torarnv requested a review from a team as a code owner May 29, 2025 12:57
@torarnv
Copy link
Copy Markdown
Contributor Author

torarnv commented May 29, 2025

I see there's a copy of the docs in cmd/packer-sdc/internal/renderdocs/docs-partials/packer-plugin-sdk/bootcommand/BootConfig.mdx as well. Do I need to update those? If so, how?

@hisaac
Copy link
Copy Markdown

hisaac commented Sep 18, 2025

@anshulsharma-hashicorp, @anurag5sh, @JenGoldstrich, would one of you have time to review this PR, or suggest someone else who could? I'd love to get this one merged in. It would make working with macOS VMs nicer.

@torarnv
Copy link
Copy Markdown
Contributor Author

torarnv commented Oct 17, 2025

@anshulsharma-hashicorp, @anurag5sh, @JenGoldstrich is there any feedback on this PR? How do we proceed? Thanks 😊

@torarnv
Copy link
Copy Markdown
Contributor Author

torarnv commented Jan 18, 2026

@anshulsharma-hashicorp, @anurag5sh, @JenGoldstrich Can you please comment on this PR? Thanks

@torarnv torarnv force-pushed the add-command-option-bootcommand-keys branch from c4c5259 to 81531cc Compare January 18, 2026 16:47
torarnv added a commit to torarnv/packer-plugin-tart that referenced this pull request Jan 18, 2026
Awaiting the merge of the feature in the upstream Packer SDK repo,
let's override the plugin SDK with a branch that has the feature.

See hashicorp/packer-plugin-sdk#293
torarnv added a commit to torarnv/packer-plugin-tart that referenced this pull request Jan 27, 2026
Awaiting the merge of the feature in the upstream Packer SDK repo.

See hashicorp/packer-plugin-sdk#293
torarnv added a commit to torarnv/packer-plugin-tart that referenced this pull request Jan 27, 2026
Awaiting the merge of the feature in the upstream Packer SDK repo.

See hashicorp/packer-plugin-sdk#293
torarnv added a commit to torarnv/packer-plugin-tart that referenced this pull request Jan 27, 2026
Awaiting the merge of the feature in the upstream Packer SDK repo.

See hashicorp/packer-plugin-sdk#293
@torarnv
Copy link
Copy Markdown
Contributor Author

torarnv commented Jan 27, 2026

@tanmay-hc Is Packer maintained still?

edigaryev pushed a commit to cirruslabs/packer-plugin-tart that referenced this pull request Jan 28, 2026
Awaiting the merge of the feature in the upstream Packer SDK repo.

See hashicorp/packer-plugin-sdk#293
@torarnv
Copy link
Copy Markdown
Contributor Author

torarnv commented Feb 18, 2026

@devashish-patel @taru-garg-hashicorp @kp2099 Would appreciate a review of this PR, thanks!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the boot command special-key vocabulary so macOS automation can refer to Command/Option by their natural names, including left/right variants, across the boot command parser and relevant drivers.

Changes:

  • Added <leftCommand>/<rightCommand> and <leftOption>/<rightOption> to the boot command grammar and regenerated the parser.
  • Added corresponding key mappings for the VNC and USB bootcommand drivers.
  • Updated boot command documentation to mention the new special keys.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
bootcommand/vnc_driver.go Adds VNC keysym mappings for left/right Command and Option.
bootcommand/usb_driver.go Adds USB scancode mappings for left/right Command and Option.
bootcommand/config.go Documents the new special keys.
bootcommand/boot_command.pigeon Extends the grammar to recognize the new special keys.
bootcommand/boot_command.go Regenerated parser output reflecting the grammar changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bootcommand/vnc_driver.go
Comment thread bootcommand/usb_driver.go
Comment thread bootcommand/boot_command.pigeon
Comment thread bootcommand/config.go
@tanmay-hc
Copy link
Copy Markdown
Contributor

Hey @torarnv
Any updates on this PR? Would love to review if you can resolve the copilot comments as the PR is currently incomplete.

The super key maps to ⌘ for the USB driver, but for the VNC
driver ⌘ is produced by left/right Alt, so we can't promise
that leftSuper/rightSuper produces ⌘.
@torarnv torarnv force-pushed the add-command-option-bootcommand-keys branch from 81531cc to 1d2cee7 Compare May 20, 2026 21:05
@torarnv
Copy link
Copy Markdown
Contributor Author

torarnv commented May 20, 2026

@tanmay-hc Thanks, updated PR per review suggestions :)

@tanmay-hc tanmay-hc requested a review from Copilot May 21, 2026 13:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • bootcommand/boot_command.go: Language not supported

When automating macOS systems it's convenient to refer to the
keys by their natural names, and for the VNC driver none of the
existing special keys mapped to option, so this enables boot
commands using the option key.
@torarnv torarnv force-pushed the add-command-option-bootcommand-keys branch from 1d2cee7 to 5787050 Compare May 21, 2026 21:33
@torarnv
Copy link
Copy Markdown
Contributor Author

torarnv commented May 21, 2026

Update generated files to fix test. make generate didn't do anything because my checkout dir was named sdk, not packer-plugin-sdk.

Copy link
Copy Markdown
Contributor

@tanmay-hc tanmay-hc left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. Looks good to me.

@tanmay-hc tanmay-hc merged commit 14270c1 into hashicorp:main May 25, 2026
8 checks passed
@torarnv torarnv deleted the add-command-option-bootcommand-keys branch May 26, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants