You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works fine for the most part except when windows are resized and spawn with a different size, as is the case often with tiling window managers.
In my config I have set the right-hand prompt to be a regular prompt with alignment: right and this enables me to have the CWD as seen on the left on the same line as kubernetes and other information on the right.
I would like to switch to rprompt for the right-hand side, as this removes the issue about the prompt moving around like this:
How can you have transient prompt like in the first image, but have the rprompt be on the same line as the cwd-part? if I change the right-hand part to rprompt it is on the same line as the prompt itself no matter what I try to do with newlines etc:
Here is my config for reference:
$schema: "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json"final_space: truedisable_notice: trueauto_upgrade: falseversion: 2blocks:
- alignment: lefttype: promptsegments:
- type: pathbackground: magentaforeground: blacktrailing_diamond: leading_diamond: style: diamond#template: "{{ if .Writable }}{{else}}{{end}}<b>{{ .Path }}</b>"template: "<b>{{ .Path }}</b>"properties:
style: fullfolder_format: "%s"
- type: gitbackground_templates:
- "{{ if or (.Working.Changed) (.Staging.Changed) }}lightYellow{{ end }}"
- "{{ if and (gt .Ahead 0) (gt .Behind 0) }}red{{ end }}"
- "{{ if gt .Ahead 0 }}blue{{ end }}"
- "{{ if gt .Behind 0 }}lightRed{{ end }}"foreground_templates:
- "{{ if or (.Working.Changed) (.Staging.Changed) }}black{{ end }}"
- "{{ if and (gt .Ahead 0) (gt .Behind 0) }}black{{ end }}"
- "{{ if gt .Ahead 0 }}black{{ end }}"background: greenforeground: blackstyle: powerlinepowerline_symbol: template: " {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} {{ .StashCount }}{{ end }} "properties:
branch_icon: " "cherry_pick_icon: " "commit_icon: " "fetch_status: truefetch_upstream_icon: falsemerge_icon: " "no_commits_icon: " "rebase_icon: " "revert_icon: " "tag_icon: " "
- type: sessionstyle: diamondleading_diamond: trailing_diamond: template: " {{ if .SSHSession }}{{ end }}{{ .UserName }} "background: lightCyanforeground: black
- type: promptalignment: right# newline: truesegments:
- type: kubectlbackground: lightBlueforeground: blackleading_diamond: trailing_diamond: style: diamondtemplate: '{{ $context := splitList "/" .Context }}{{ index $context 0 }}'
- type: kubectlbackground: cyanforeground: blackleading_diamond: trailing_diamond: style: diamondtemplate: '<b>{{ $context := splitList "/" .Context }} {{$cluster:=regexReplaceAll "^api-os-" .Cluster "" }}{{ $leftMost := regexReplaceAll "-[^-]+-[^-]+:.*" $cluster "" }}{{ $leftMost }} </b>'
- type: kubectlbackground: yellowforeground: blackleading_diamond: style: diamondtemplate: "{{ .Namespace }}"trailing_diamond:
- type: promptalignment: leftnewline: truesegments:
- background: transparentforeground_templates:
- "{{if gt .Code 0}}red{{end}}"
- "{{if eq .Code 0}}lightBlue{{end}}"style: plaintemplate: ❯type: texttransient_prompt:
foreground_templates:
- "{{if gt .Code 0}}red{{end}}"
- "{{if eq .Code 0}}green{{end}}"background: transparenttemplate: "❯ "secondary_prompt:
foreground: lightBluebackground: transparenttemplate: "❯❯ "
The text was updated successfully, but these errors were encountered:
@kritag you can't. The transient prompt is a simplified prompt so you can't enable a full prompt config. This might be something to explore, but today that's not an option.
JanDeDobbeleer
changed the title
rprompt with transient prompt not on the same line
feat: allow full prompt config for transient prompt
Oct 28, 2024
If i disable the transient prompt alltogether I still get the same behavior having rprompt on the same line of the prompt. Is there like a hack of sorts to push the rprompt one line above? I mean, here is the behavior with transient prompt disabled:
If I add a newline in the rprompt segment I get:
Does this mean that rprompt is always rendered last, no matter how you structure your configuration? Or is there a way to structure it in order to achieve the result I'm after?
@kritagrprompt will always be rendered on the line of the cursor, that's the design (native, or not). If you want to display it above, create a right aligned prompt rather than an rprompt.
Code of Conduct
What would you like to see changed?
Currently I have my prompt set up like this:
This works fine for the most part except when windows are resized and spawn with a different size, as is the case often with tiling window managers.
In my config I have set the right-hand prompt to be a regular prompt with
alignment: right
and this enables me to have the CWD as seen on the left on the same line as kubernetes and other information on the right.I would like to switch to rprompt for the right-hand side, as this removes the issue about the prompt moving around like this:
How can you have transient prompt like in the first image, but have the rprompt be on the same line as the cwd-part? if I change the right-hand part to rprompt it is on the same line as the prompt itself no matter what I try to do with newlines etc:
Here is my config for reference:
The text was updated successfully, but these errors were encountered: