batch file - Command segment in .omp.json Oh-my-posh theme - Stack Overflow
I've been modifying to my taste, the theme kali, from oh my posh.
I encountered the following problem.
I have this segment
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "command",
"style": "plain",
"foreground": "#ffffff",
"properties": {
"shell": "cmd",
"command": "cmd /C D:\\repos\\zsh-pwsh-wt\\windows-pws-posh\\center.bat"
},
"template": "{{ .Output }}"
}
]
},
The point of that segment is to print a line as wide as the window above the main prompt. I do it through cmd because of compatibility issues with pwsh.
The file center.bat
works perfectly by its own, prints the line as it should.
The problem is that when I call that script file, the line it prints is shorter than the window width.
Here are examples:
Running the script directly:
Adding the segment/block:
Also, this example scenario:
- When I run
center.bat
by itself the width is 172. - When it's run from
omp.json
, it is 120.
Checking again, it always returns 120 when it runs from the template, despite the window size.
- Template:
> {
"$schema": ".json",
"blocks": [
{
"type": "prompt",
"alignment": "right",
"segments": [
{
"type": "command",
"style": "plain",
"foreground": "#ffffff",
"properties": {
"shell": "cmd",
"command": "cmd /C D:\\repos\\zsh-pwsh-wt\\windows-pws-posh\\center.bat"
},
"template": "{{ .Output }}"
}
]
},
{
"alignment": "left",
"segments": [
{
"properties": { "display_host": true },
"style": "plain",
"template": "\n<#ffffff>\u250c\u2500\u2500(</#ffffff><#00FF00>{{ .UserName }}</#00FF00>
最新文章
- 从基础软硬件兼容性谈桌面云的应用
- 紫光集团两年内豪掷90亿美元
- 鲍尔默安抚硬件伙伴:Surface只是一个参考设计
- android - Segmentation Fault at start up of Maui App - Stack Overflow
- javascript - Responsiveness textContent (graphic) - Stack Overflow
- python - Could NOT find Python3 during cmake - Stack Overflow
- windows - Vite-electron configuration for own js logic code - Stack Overflow
- Symfony 7 - Autocomplete form field - Stack Overflow
- sql - Rolling sum that resets at a flag - Stack Overflow
- regex - Change text block with nearest search pattern - Stack Overflow
- docker-compose elasticsearch absolute clock went backwards - Stack Overflow
- docker - Python Telegram bot freezes when run by Airflow - Stack Overflow
- In Visual Studio 2022, Can not export and import new Project Template - Stack Overflow
- json - How do I convert a string to a table in Lua? - Stack Overflow
- python - Unable to get form data in database and getting type object 'UserRegister' has no attribute 'US
- volttron - POSTMAN REST Call Results in RPC Timed Out: 5 Seconds - Stack Overflow
- swift - Codable class does not conform to protocol Decodable because of TimeStamp, new Error wasn't there before - Stack