-
-
Notifications
You must be signed in to change notification settings - Fork 61
feat(shell): support completion in the middle of a prompt #450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi, thanks for the PR. If that's the default behavior we're targetting, I'd like all shells to be consistent with it. If you feel up for the task, have fun :) Otherwise I'll take this when I find the time. Cheers |
Ok I think it's been done. For bash and zsh we had to add local output=$(tv --autocomplete-prompt "$current_prompt" | tr '\n' ' ') This seems fine for all the completion use cases I could think of (except history which has it's own function and we're not touching it). |
Sweet, thanks for the great work 🙏🏻 |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [alexpasmantier/television](https://github.com/alexpasmantier/television) | patch | `0.11.4` -> `0.11.7` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>alexpasmantier/television (alexpasmantier/television)</summary> ### [`v0.11.7`](https://github.com/alexpasmantier/television/blob/HEAD/CHANGELOG.md#0117---2025-04-12) [Compare Source](alexpasmantier/television@0.11.6...0.11.7) ##### ⛰️ Features - [cb0a46f](alexpasmantier/television@cb0a46f) *(input)* Add action to delete input line by [@​alexpasmantier](https://github.com/alexpasmantier) in [#​464](alexpasmantier/television#464) - [de6200e](alexpasmantier/television@de6200e) *(shell)* Support completion in the middle of a prompt by [@​dkmar](https://github.com/dkmar) in [#​450](alexpasmantier/television#450) ##### 🐛 Bug Fixes - [425be1e](alexpasmantier/television@425be1e) *(ui)* Fix slight responsiveness regression in 0.11.6 by [@​alexpasmantier](https://github.com/alexpasmantier) in [#​461](alexpasmantier/television#461) ##### ⚙️ Miscellaneous Tasks - [e23c307](alexpasmantier/television@e23c307) *(changelog)* Update changelog (auto) by [@​github-actions](https://github.com/github-actions)\[bot] in [#​458](alexpasmantier/television#458) - [6771ecd](alexpasmantier/television@6771ecd) *(project)* Migrate from Makefile to Just by [@​alexpasmantier](https://github.com/alexpasmantier) in [#​463](alexpasmantier/television#463) - [1693584](alexpasmantier/television@1693584) *(uncategorized)* Bump to 0.11.7 by [@​alexpasmantier](https://github.com/alexpasmantier) **Full Changelog**: alexpasmantier/television@0.11.6...0.11.7 ### [`v0.11.6`](https://github.com/alexpasmantier/television/blob/HEAD/CHANGELOG.md#0116---2025-04-09) [Compare Source](alexpasmantier/television@0.11.5...0.11.6) ##### ⛰️ Features - [5bf3d20](alexpasmantier/television@5bf3d20) *(cli)* Add a `--no-help` flag to allow disabling showing the help panel by [@​alexpasmantier](https://github.com/alexpasmantier) in [#​456](alexpasmantier/television#456) - [b818737](alexpasmantier/television@b818737) *(cli)* Add a `--no-remote` flag to lock the application on the cli-invoked channel by [@​alexpasmantier](https://github.com/alexpasmantier) in [#​455](alexpasmantier/television#455) - [4892dc3](alexpasmantier/television@4892dc3) *(cli)* Add `--select-1` cli flag to automatically select unique result by [@​alexpasmantier](https://github.com/alexpasmantier) in [#​448](alexpasmantier/television#448) ##### 🐛 Bug Fixes - [4a584b4](alexpasmantier/television@4a584b4) *(pwsh)* Use adequate quoting when formatting preview commands for pwsh by [@​alexpasmantier](https://github.com/alexpasmantier) in [#​454](alexpasmantier/television#454) - [d4913d7](alexpasmantier/television@d4913d7) *(uncategorized)* Silence the `string match` in tv_smart_autocomplete by [@​dkmar](https://github.com/dkmar) in [#​449](alexpasmantier/television#449) ##### 🚜 Refactor - [69c4dcc](alexpasmantier/television@69c4dcc) *(debug)* Improve configuration debug logging by [@​alexpasmantier](https://github.com/alexpasmantier) in [#​447](alexpasmantier/television#447) - [82e3f89](alexpasmantier/television@82e3f89) *(passthrough)* Drop support for unused passthrough keybindings by [@​alexpasmantier](https://github.com/alexpasmantier) in [#​446](alexpasmantier/television#446) \[**breaking**] ##### ⚙️ Miscellaneous Tasks - [8b267bb](alexpasmantier/television@8b267bb) *(changelog)* Update changelog (auto) by [@​github-actions](https://github.com/github-actions)\[bot] in [#​443](alexpasmantier/television#443) - [a008d3f](alexpasmantier/television@a008d3f) *(uncategorized)* Bump to 0.11.6 by [@​alexpasmantier](https://github.com/alexpasmantier) in [#​457](alexpasmantier/television#457) ##### New Contributors - [@​dkmar](https://github.com/dkmar) made their first contribution in [#​449](alexpasmantier/television#449) **Full Changelog**: alexpasmantier/television@0.11.5...0.11.6 ### [`v0.11.5`](https://github.com/alexpasmantier/television/blob/HEAD/CHANGELOG.md#0115---2025-03-31) [Compare Source](alexpasmantier/television@0.11.4...0.11.5) ##### 🐛 Bug Fixes - [6ba235f](alexpasmantier/television@6ba235f) *(results)* Fix alignment for non unit width unicode characters by [@​alexpasmantier](https://github.com/alexpasmantier) in [#​442](alexpasmantier/television#442) ##### ⚙️ Miscellaneous Tasks - [f9a49ac](alexpasmantier/television@f9a49ac) *(changelog)* Update changelog (auto) by [@​github-actions](https://github.com/github-actions)\[bot] in [#​436](alexpasmantier/television#436) - [875b63d](alexpasmantier/television@875b63d) *(uncategorized)* Bump to 0.11.5 by [@​alexpasmantier](https://github.com/alexpasmantier) **Full Changelog**: alexpasmantier/television@0.11.4...0.11.5 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjIuMyIsInVwZGF0ZWRJblZlciI6IjM5LjIzOC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
I think it's better to insert our output at the cursor so this can be invoked in the middle of a prompt. Previously we would assume the cursor is at the end of the prompt and invocation in the middle of one would discard everything after the cursor.