Closed tradjincal closed 3 months ago
Reading something interesting about this on the interwebs:
the
\n
character works but it requires that ' ' space before it, don't know why.
We currently only print \n
without a space. Will have a look at if this is actually true or not. You could try adding a text segment with that value where you expect the newline as a test.
Confirmed. This works and requires a huge facepalm.
#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
version = 2
final_space = true
console_title_template = '{{ .Folder }} @ {{ .HostName }}'
[[blocks]]
type = 'prompt'
alignment = 'left'
newline = true
[[blocks.segments]]
type = 'path'
style = 'plain'
background = 'transparent'
foreground = 'blue'
template = '{{ .Path }}'
[blocks.segments.properties]
style = 'full'
[[blocks.segments]]
type = 'git'
style = 'plain'
foreground = 'p:grey'
background = 'transparent'
template = ' {{ .HEAD }}'
[blocks.segments.properties]
branch_icon = ' '
commit_icon = '@'
fetch_status = true
[[blocks]]
type = 'rprompt'
overflow = 'hidden'
[[blocks.segments]]
type = 'executiontime'
style = 'plain'
foreground = 'yellow'
background = 'transparent'
template = '{{ .FormattedMs }}'
[blocks.segments.properties]
threshold = 5000
[[blocks]]
type = 'prompt'
alignment = 'left'
[[blocks.segments]]
type = 'text'
style = 'plain'
foreground_templates = [
"{{if gt .Code 0}}red{{end}}",
"{{if eq .Code 0}}magenta{{end}}",
]
background = 'transparent'
template = ' \n'
[[blocks.segments]]
type = 'text'
style = 'plain'
foreground_templates = [
"{{if gt .Code 0}}red{{end}}",
"{{if eq .Code 0}}magenta{{end}}",
]
background = 'transparent'
template = '❯'
[transient_prompt]
foreground_templates = [
"{{if gt .Code 0}}red{{end}}",
"{{if eq .Code 0}}magenta{{end}}",
]
background = 'transparent'
template = '❯ '
[secondary_prompt]
foreground = 'magenta'
background = 'transparent'
template = '❯❯ '
It works perfectly now. Thanks for the support.
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.
Code of Conduct
What happened?
Hello, There is only one line with my prompt in a tcsh shell. I tried the same config with bash and it work perfectly fine.
Theme
What OS are you seeing the problem on?
Linux
Which shell are you using?
tcsh
Log output