-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
<C-u> to clear watch mode pattern prompt #11296
Comments
This is a Bash thing, but it probably works in most shell emulators (it does in zsh which I use at least). If we add ctrl+u, we should also do others, like meta/ctrl+b and meta/ctrl+f etc. Feels like a somewhat slippery slope, but perhaps there's some library we can use which parses the input and returns a "command" of some sort that's easier to understand? Or even better would be some "cursor" library which, given a string and a position can parse terminal input and return a new string (if it modifies it) and cursor position. I've done zero research into whether such a thing already exists 🙂 |
Yeah, but it's also supported in many non-shell places in "the terminal", like in Vim insert mode, when editing a tmux command line, ..., hence why I phrased it more generally as "terminal environments". Not sure how much of a slippery slope it is, I don't think there are many common commands that would be meaningful in the pattern prompt, and especially none that are as ubiquitous across different applications as . |
We should definitely have moving backwards and forwards (plus deleting words) if we start adding support for "commands". That might be it, though? |
Oh, and perhaps notably is supported in the login prompt on Linux as well, before you even get a shell.
Yeah it seems moving forward and backward is about as ubiquitous. Would be nice if a library gives us everything for free - I've edited the description to say this should be checked - but I wouldn't mind introducing one without the other if it's easier since it's better than nothing. |
Hi @jeysal @SimenB could I work on this issue? I think I can implement the Here is what I have in mind:
|
@parthsharma2 sounds about right yeah :) |
@jeysal I've committed the changes I mentioned in the previous message
parthsharma2@ad78494
I've added a test case along with it & it is passing. I also tried to run
it manually by `yarn build` & then `yarn test --watch` but it seems like I
can't get it to run the latest changes.
Is it possible for you to test it at your end or could you let me know how
I should test these changes?
…On Sun, Apr 25, 2021 at 1:24 AM Tim Seckinger ***@***.***> wrote:
@parthsharma2 <https://github.com/parthsharma2> sounds about right yeah :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11296 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFJ2UQ6C4LPSY3EJ6A3OCYTTKMOZFANCNFSM425FSMZA>
.
|
Hi @parthsharma2 and thanks a lot for doing this! |
@SimenB I could add support for |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
Currently, pressing Ctrl+u in a watch mode pattern prompt inserts an invisible character that also somewhat breaks searching because the files/tests searched for do not contain the character.
In most terminal environments, Ctrl+u clears the whole line. I think this should happen in the watch mode pattern prompt as well.
Motivation
Many users will expect Ctrl+u to behave as elsewhere in their terminal environment.
The workaround requires pressing backspace a lot to clear the line manually.
Pitch
Why does this feature belong in the Jest core platform?
Since
jest-watcher
sPrompt
is reused in third-party packages likejest-watch-typeahead
, making the improvement here would benefit those as well as users of plain Jest watch mode prompts.The text was updated successfully, but these errors were encountered: