-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Right-aligned prompts are not right-aligned in Bash/mintty on Windows #5090
Comments
@Bilge weird this has never been reported before. I can try to have a look. |
Due to git bash' broken nature it can't interact nicely with the native Windows API and thus reported the incorrect terminal width. Fix incoming. |
Thanks for the fast fix 🙂 👍🏻 The default theme is right-aligned; my (slightly modified) version of P10K is not quite aligned to the right-hand edge but that probably just requires some tweaking. |
I'll have a look, this shouldn't happen although it can be another git bash bug. Does the same happen inside Windows Terminal? |
It does not happen in PowerShell in Windows Terminal... although it's not really a fair test since I'm not using the Nerd font in Windows Terminal (nor am I using Bash). I tried to get it to run in WSL 1, but it doesn't work because the init script spits out the host path instead of the mounted path in WSL. |
@Bilge you can run bash also in Windows Terminal, doesn't need to be PWSH. |
Sure, but it keeps messing up the path. Whether under WSL 1 or just To be clear, the init script is the same under git Bash, but git Bash is clever in that it automatically remaps references to |
@Bilge not a bug. When using WSL, you need to use the linux executable. I meant you can run git bash, which is a Windows runtime faking linux tooling, inside Terminal. WSL is a linux runtime, so it needs to Linux oh-my-posh to work. |
So you claim, and yet WSL 1 can run Windows native binaries, including oh-my-posh just fine. After all, it spits out the init script, it's only the paths that are incorrect. Case in point, Of course, what you are suggesting isn't wrong; I could install it twice, using the native runtime, it's just that I don't want to install it twice 🙂 |
@Bilge I know it can, and on WSL1 it will be "fast", on 2 slow and it's going to interact with Windows API's whereas the context is actually a linux runtime. It can be solved, but I purposefully don't do that. It's not a good idea. |
Anyway, using the |
@Bilge I'm going to have a look, always interesting. |
Having installed the LiterationMono Nerd Font in Windows Terminal, it still seems to be printing consistent widths (with consistent right-alignment), so the alignment issue seems to be purely isolated to git Bash. Probably I am the only one trying to use OMP in the git Bash environment, which is why none of these issues have been discovered before 😆 |
@Bilge trust me, there are plenty 😁 But, people do tend to use Windows Terminal with git bash rather than mintty. |
Uh... git Bash uses mintty. They are, effectively, one and the same. |
@Bilge mintty is the terminal emulator, not the shell. You can run git bash as is inside Windows Terminal. |
@Bilge you can use this configuration to see what bash behaves like in Windows Terminal: {
"commandline": "%PROGRAMFILES%/Git/usr/bin/bash.exe -i -l",
"guid": "{00000000-0000-0000-ba54-000000000002}",
"icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico",
"name": "Bash",
"startingDirectory": "%USERPROFILE%"
} Git Bash is actually mintty that runs this bash version inside as a packaged entity. That said, I don't have the above issue with my theme. ![]() I can reproduce this using Git's Bash with ![]() You can fix it by adjusting the configuration for the ![]() I'll see if I can add that as the native behaviour and hopefully that's the last of Git Bash' shenanigans. I do promote the use of nushell when you dislike PowerShell on Windows, that's a really, really good shell that integrates natively with Windows unlike Git Bash. |
I guess changing |
@Bilge I can reproduce the issue on bash anywhere using |
@Bilge after a good night's rest, I found the issue and oh-my-posh is responsible. We escape |
Hi @JanDeDobbeleer, I have a problem after using the latest version. Could you please support me to fix it? |
@hungnguyen1503 set |
Hi @JanDeDobbeleer, |
Code of Conduct
What happened?
The right-aligned portions of the prompt are never right-aligned; they sit somewhere in the middle of the screen. Moreover, they keep changing their alignment depending on the width of the left-aligned segments, which is weird.
In case you are supposing this is a limitation with Bash/mintty, the same feature works fine in Starship.
Theme
powerlevel10k_rainbow
What OS are you seeing the problem on?
Windows
Which shell are you using?
bash
Log output
The text was updated successfully, but these errors were encountered: