Skip to content
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

[User] Support for newline reverse prompt #1362

Closed
MrJackSpade opened this issue May 8, 2023 · 5 comments
Closed

[User] Support for newline reverse prompt #1362

MrJackSpade opened this issue May 8, 2023 · 5 comments
Labels

Comments

@MrJackSpade
Copy link

It would be really helpful to be able to define return carriage and newline as reverse prompts.

It doesn't look like there's a way to cause control to return on a new line. I've tried a few different combinations on the command line, but it flies right through them while generating.

@DannyDaemonic
Copy link
Contributor

I guess I could make -e work on reverse prompts as well. It wouldn't work as is, but out of curiosity, did you try "\n"?

In Linux or macOS, try -r $'\n'. If you're in Windows and don't have Powershell, I think it's impossible, but if you have it installed, you should be able to do it like this -r "`n" (that's the tick mark above the ~ key).

@MrJackSpade
Copy link
Author

I'm on Windows.

Here is the results of my testing

  1. "`n" in PowerShell appears to work
  2. "\n" (literal) through PInvoke command line arguments appears to work
  3. "\n" (escape sequence) does not appear to work in any context

Given the above, I would expect "^\n" (literal) to work through cmd.exe, however I haven't tested that since (2) actually solves my use case.

It might be a good idea to add a note to the documentation.

It would also be nice to have the -e work on the reverse prompt as well, but as long as there's a note in the document its probably not necessary. Its always good to have the functionality standardized across the different parameters though. I assumed using a literal wouldn't work largely because -e was offered on the prompt.

Feel free to close this ticket

@SlyEcho
Copy link
Collaborator

SlyEcho commented May 9, 2023

-e could be made to work for other text arguments. But should it change all of them or just the next following one...

@trollkotze
Copy link

-e could be made to work for other text arguments. But should it change all of them or just the next following one...

I think for each individual argument would be better to have more control.

@github-actions github-actions bot added the stale label Mar 25, 2024
Copy link
Contributor

github-actions bot commented Apr 9, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants