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

$PS2 #32

Open
1 of 2 tasks
Roy-Orbison opened this issue Oct 25, 2024 · 2 comments
Open
1 of 2 tasks

$PS2 #32

Roy-Orbison opened this issue Oct 25, 2024 · 2 comments

Comments

@Roy-Orbison
Copy link

Feature Description

When a prompt overflows a line (from unclosed strings or \ to deliberately continue a line), bash uses PS2 as the secondary prompt. I colour this as well, which looks a lot better than the default. E.g. if my PS1 ends with \[\e[38;5;131m\]\$\[\e[0m\] , my PS2 will be \[\e[38;5;131m\]>\[\e[0m\] .

Can you add an optional Secondary Prompt section that, if completed adds a PS2='...' line to the Output and its result to the Preview?

Not a duplicate

  • This is not a duplicate

Want to Implement

  • I want to implement this feature
@Scriptim
Copy link
Owner

Would it be sufficient for your use case to simply generate a prompt and then (manually) replace PS1 with PS2 in the output?

I might add a radio selection in the future that allows you to switch between PS1 and PS2 in the output. However, I'd consider a completely new section that allows parallel editing of both prompts to be confusingly complex and more difficult to use.

@Roy-Orbison
Copy link
Author

I leave the last prompt I made as the basis for the next, and change colours per machine, so that wouldn't help. I create PS2 manually, anyway.

I brought this up because I think more people would customise the secondary if they knew about it, and using it a couple of times in the Example Preview would make it pretty clear what it does. Leaving it blank would default to > elements. E.g.:

user@host:~/a/path/to/somewhere
$ echo 'A text interface
> My reliable workhorse
> Drat, missed a colon' > bash-haiku

It's better UX to have both variables in the Output.

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

No branches or pull requests

2 participants