JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.37k stars 2.38k forks source link

Allow transient prompt alignment (segments or left/right_template or whatever...) #4822

Open joerohde opened 7 months ago

joerohde commented 7 months ago

Code of Conduct

What would you like to see changed/added?

Related: 3844

Mostly care about powershell, but would like to use for zsh. Pretty much a dup of referenced issue, but I'll give my use cases:

  1. I have a multi-line prompt and I want to reduce it to 1 line with the more/most important info via transient mechanics.
  2. Filler, which sort of works, should automatically be applied after the command input instead of before.

As opposed to going all out and supporting multiple segments, I would be thrilled just to have: left_template -> alias for 'template' right_template -> right aligned (after optional filler) template.

Image attached of my powerlevel10k zsh prompt usage that I'd like to replace. It looks noisy especially because I used short-output commands with a somewhat narrow screen to demo.

image
joerohde commented 7 months ago

BTW: If there's no philosophical issue with this, and you'd like to let me know what syntax/json form you prefer, I can take a shot at it. I'm good with go, but not so good with Powershell. :)

patrick91 commented 1 month ago

I'd love this feature too, not sure how it could be implemented though, maybe we can have a command that says everything after this goes on the right?

So like this:

[transient_prompt]
  template = '➜ {float-right}[{{now | date "15:04:05"}}]'
JanDeDobbeleer commented 1 month ago

@patrick91 this is on my list to look at this year still. Keep you posted.