Title: Escape does not cancel a launch that uses command:SpecifyProgramArgs · Issue #1450 · microsoft/vscode-java-debug · GitHub
Open Graph Title: Escape does not cancel a launch that uses command:SpecifyProgramArgs · Issue #1450 · microsoft/vscode-java-debug
X Title: Escape does not cancel a launch that uses command:SpecifyProgramArgs · Issue #1450 · microsoft/vscode-java-debug
Description: When launching a Java program with ${command:SpecifyProgramArgs}, the popup says that I can press 'Escape' to cancel, but it runs anyway. Environment Operating System: Windows 11 JDK version: 17.0.4.1 Visual Studio Code version: 1.86.2 J...
Open Graph Description: When launching a Java program with ${command:SpecifyProgramArgs}, the popup says that I can press 'Escape' to cancel, but it runs anyway. Environment Operating System: Windows 11 JDK version: 17.0....
X Description: When launching a Java program with ${command:SpecifyProgramArgs}, the popup says that I can press 'Escape' to cancel, but it runs anyway. Environment Operating System: Windows 11 JDK versio...
Opengraph URL: https://github.com/microsoft/vscode-java-debug/issues/1450
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Escape does not cancel a launch that uses command:SpecifyProgramArgs","articleBody":"When launching a Java program with `${command:SpecifyProgramArgs}`, the popup says that I can press 'Escape' to cancel, but it runs anyway.\r\n\r\n##### Environment\r\n- Operating System: Windows 11\r\n- JDK version: 17.0.4.1\r\n- Visual Studio Code version: 1.86.2\r\n- Java extension version: 1.28.1\r\n- Java Debugger extension version: 17.0.4.1\r\n\r\n##### Steps To Reproduce\r\n1. Open the repo https://github.com/sbj42/vscode-specifyprogramargs\r\n2. Open `Test.java` and press `F5`.\r\n3. Pop-up appears with \"Press 'Enter' to confirm your input or 'Escape' to cancel\".\r\n4. Press Escape.\r\n5. Terminal appears and runs the test program with no arguments.\r\n\r\nSee repo above, but you only need these two files:\r\n\r\n`Test.java`:\r\n```java\r\npublic class Test {\r\n public static void main(String[] args) {\r\n System.out.println(\"args: \" + String.join(\" \", args));\r\n }\r\n}\r\n```\r\n\r\n`.vscode/launch.json`:\r\n```json\r\n{\r\n \"version\": \"0.2.0\",\r\n \"configurations\": [\r\n {\r\n \"type\": \"java\",\r\n \"name\": \"Launch with Arguments Prompt\",\r\n \"request\": \"launch\",\r\n \"mainClass\": \"\",\r\n \"args\": \"${command:SpecifyProgramArgs}\"\r\n }\r\n ]\r\n}\r\n```\r\n\r\nVerbose output log from \"Language Support for Java\": [log.txt](https://github.com/microsoft/vscode-java-debug/files/14409424/log.txt)\r\n\r\n##### Current Result\r\n\r\nThe debug session starts with no arguments.\r\n\r\n##### Expected Result\r\n\r\nThe debug session should not start, because it was cancelled.\r\n\r\n##### Additional Informations\r\n\r\nThe implementation of `SpecifyProgramArgs` is at [extension.ts:185](https://github.com/microsoft/vscode-java-debug/blob/b38e1df9c3d44dce15703f04ec2863f6e34593ea/src/extension.ts#L185). When the user cancels, the function returns a string with a single space. That's indistinguishable from the user entering a space in the input.\r\n\r\nI presume that throwing some sort of cancellation exception would be good here, for instance `throw new Error('Launch cancelled')`. It would be even better if the exception didn't display an error box, but I don't know enough about vscode extension command handlers to know if that's possible.\r\n\r\nAlternatively you could just remove the \"or 'Escape' to cancel\" hint in the input popup.","author":{"url":"https://github.com/sbj42","@type":"Person","name":"sbj42"},"datePublished":"2024-02-26T19:01:24Z","url":"https://github.com/microsoft/vscode-java-debug/issues/1450"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7d190b13-ea4b-e88e-b6f8-6708a718241b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ACD4:35C921:23BFAD2:30DF116:6B07348E |
| html-safe-nonce | 0b65ec88ac2479d7d5738eb0592a0512bd64e1af286646f477f19d1f8a075b5b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0Q0OjM1QzkyMToyM0JGQUQyOjMwREYxMTY6NkIwNzM0OEUiLCJ2aXNpdG9yX2lkIjoiNjM2OTI2Mzg1MjY2ODI2OTcxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0d90e1ae183861709308b137cc55ad83481ecb57c2797b00d9d3181aaa7e1d8a |
| hovercard-subject-tag | issue:2154899649 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/vscode-java-debug/1450/issue_layout |
| twitter:image | https://opengraph.githubassets.com/903e2a81a0ad410dcdedf650eeb7ad3aeb5d058fe06c35a995cc09699063076d/microsoft/vscode-java-debug/issues/1450 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/903e2a81a0ad410dcdedf650eeb7ad3aeb5d058fe06c35a995cc09699063076d/microsoft/vscode-java-debug/issues/1450 |
| og:image:alt | When launching a Java program with ${command:SpecifyProgramArgs}, the popup says that I can press 'Escape' to cancel, but it runs anyway. Environment Operating System: Windows 11 JDK version: 17.0.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sbj42 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2a60952cad7efb2604ea85e500208f51c1ec1943aa260ac605c13eb46a1ed83b |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/vscode-java-debug git https://github.com/microsoft/vscode-java-debug.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 102584737 |
| octolytics-dimension-repository_nwo | microsoft/vscode-java-debug |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 102584737 |
| octolytics-dimension-repository_network_root_nwo | microsoft/vscode-java-debug |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 345c27626db08417fdfc84278a4415ae9a48d8f3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width