Title: variable tab completion does not escape curly quotes, potentially others · Issue #10006 · PowerShell/PowerShell · GitHub
Open Graph Title: variable tab completion does not escape curly quotes, potentially others · Issue #10006 · PowerShell/PowerShell
X Title: variable tab completion does not escape curly quotes, potentially others · Issue #10006 · PowerShell/PowerShell
Description: Similar to #9881, while attempting to tab complete a variable reference, at least curly quotes (I've also determined en-dash/em-dash too) do not cause an escape to the ${ } notation. Steps to reproduce ${test`u{2018}var} = 'Hello World' ...
Open Graph Description: Similar to #9881, while attempting to tab complete a variable reference, at least curly quotes (I've also determined en-dash/em-dash too) do not cause an escape to the ${ } notation. Steps to repro...
X Description: Similar to #9881, while attempting to tab complete a variable reference, at least curly quotes (I've also determined en-dash/em-dash too) do not cause an escape to the ${ } notation. Steps to r...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/10006
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"variable tab completion does not escape curly quotes, potentially others","articleBody":"Similar to #9881, while attempting to tab complete a variable reference, at least curly quotes (I've also determined en-dash/em-dash too) do not cause an escape to the `${ }` notation.\r\n\r\n# Steps to reproduce\r\n\r\n```PowerShell\r\n${test`u{2018}var} = 'Hello World'\r\n\r\n$t # press tab for completion until `test‘var` appears\r\n```\r\n\r\n# Expected behavior\r\n\r\n```PowerShell\r\n${test‘var}\r\n\r\n```\r\n\r\n# Actual behavior\r\n\r\n```PowerShell\r\n$test‘var\r\n```\r\n\r\nI believe this is part of the issue:\r\nhttps://github.com/PowerShell/PowerShell/blob/981c990d747ae97f56a6c7474e5d2ef04bf237c5/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs#L4565-L4566\r\n\r\n\r\nI think this is inadequate to catch the conditions that require when the `${ }` notation is needed, but the above constant appears to be used for more than just that. The list of characters that require the `${ }` notation is much larger and more complicated. If regex could be used, the following might be more accurate for when to require the `${ }` : `^(?:[^$^\\w?:]|[$^?].)|.(?:::|[^\\w?:])` This would return a MATCH when `${ }` is required. Examples:\r\n\r\n`$` false\r\n`$$` true\r\n`^` false\r\n`^^` true\r\n`?` false\r\n`??` true\r\n`_?` false\r\n`::` false\r\n`a::` true\r\n`test‘var` true\r\n\r\n# Environment data\r\n\r\nThis particular example was captured with 6.2.0 on Win 10 Pro 18922 (Insiders)\r\n\r\n__Edit: improved performance of the regex example.__\r\n","author":{"url":"https://github.com/msftrncs","@type":"Person","name":"msftrncs"},"datePublished":"2019-06-26T03:22:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/10006/PowerShell/issues/10006"}
| 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:572b2386-b18b-0df7-caa0-9c58a0598c39 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA48:93A86:238ED25:2FDB181:6A59A4AB |
| html-safe-nonce | dbbdf4f27168ed4b2b762cebba8690029fd6fb0d010781ad715a53b39a5b0efb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTQ4OjkzQTg2OjIzOEVEMjU6MkZEQjE4MTo2QTU5QTRBQiIsInZpc2l0b3JfaWQiOiIzNjE1NTU5MDE0MDc0MTMxNjI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 51d51ac86a64b84b6a8259b6b1529e3b6fd959e7bd8217b0fee6d060a8db7fac |
| hovercard-subject-tag | issue:460740257 |
| 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/PowerShell/PowerShell/10006/issue_layout |
| twitter:image | https://opengraph.githubassets.com/379b20d66aee39064470bbed2a661f570c24cab9068d9be6453879ddcc654988/PowerShell/PowerShell/issues/10006 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/379b20d66aee39064470bbed2a661f570c24cab9068d9be6453879ddcc654988/PowerShell/PowerShell/issues/10006 |
| og:image:alt | Similar to #9881, while attempting to tab complete a variable reference, at least curly quotes (I've also determined en-dash/em-dash too) do not cause an escape to the ${ } notation. Steps to repro... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | msftrncs |
| hostname | github.com |
| expected-hostname | github.com |
| None | a540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| 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 | 0b971869dd75eec26500a9de7e85b8137c6bf0f6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width