Skip to content

fix: updated string that identifies escape key presses when prompting for required vars#2942

Draft
anilnatha wants to merge 1 commit into
go-task:mainfrom
anilnatha:bugs/fix-variable-prompt-esc-key
Draft

fix: updated string that identifies escape key presses when prompting for required vars#2942
anilnatha wants to merge 1 commit into
go-task:mainfrom
anilnatha:bugs/fix-variable-prompt-esc-key

Conversation

@anilnatha

@anilnatha anilnatha commented Jul 26, 2026

Copy link
Copy Markdown

This PR addresses a fix needed to identify if the escape key is pressed when a user is prompted for a required variable.

The issue existed in internal/input/input.go where there were two switch statements that checked if the escape key was pressed using the string escape. However, uv identifies the escape key using the string esc, not escape. Because of this discrepancy, task never quit when the escape key was pressed after prompting the user for a required var. After changing escape to esc and running the following two tests I was able to verify that the issue has been fixed:

go run ./cmd/task --dir ./testdata/interactive_vars deploy
go run ./cmd/task --dir ./testdata/interactive_vars release

AI Disclosure: I used Cursor to help me identify where in the code the keypress events were being done when prompting for required vars. I then investigated the uv and bubbletea documentation and codebases to identify that the escape key string may have been incorrect. Then experimented on my macOS system (v26.5.2), swapping between the strings escape and esc at the locations identified in the changed files and running the two tests above a number of times.

…o 'esc' to match the string the uv identifies as the escape key.
@anilnatha anilnatha changed the title fix: fix: updated string that identifies escape key presses when prompting for required vars Jul 26, 2026
@anilnatha

anilnatha commented Jul 26, 2026

Copy link
Copy Markdown
Author

Hello, this is my first PR for this codebase.

While I have tested this change using the listed tests above, being new to this codebase I wanted to ask if I should have left the original string for escape alongside the string esc for any compatibility reasons.

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.

1 participant