JanDeDobbeleer / oh-my-posh

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

Broken Text in fish #1966

Closed carrotfarmer closed 2 years ago

carrotfarmer commented 2 years ago

Code of Conduct

What happened?

After installing ohmyposh and reloading the fish session, the prompt started behaving weirdly. It works fine when I'm in the home directory or a level above it (Documents, Desktop, Pictures, etc.), but the prompt breaks when I go to a specific directory in this level. PFA screenshot:

image image image

When this happens, I am able to delete parts of the prompt when I hit the delete key like so:

image

Theme

Default config

What OS are you seeing the problem on?

macOS

Which shell are you using?

fish

Log output

ReadMapCB: expect { or n, but found 4, error found in #1 byte of ...|404: Not Fo|..., bigger context ...|404: Not Found|...

This ^ was because I tried to make my own config to see if this issue persists, but I ended up deleting it.
JanDeDobbeleer commented 2 years ago

@carrotfarmer is this in Hyper terminal by any chance?

carrotfarmer commented 2 years ago

Yep!

carrotfarmer commented 2 years ago

Just wanted to add that this issue persists in iTerm2 too:

image
JanDeDobbeleer commented 2 years ago

@carrotfarmer I will check somewhere during lunch, haven't seen this in any other shell but I don't use fish that often (I agree it's a very nice shell). Is this a folder a public git repo perhaps?

carrotfarmer commented 2 years ago

Yes, it is. All of the folders I tested this in are public git repos.

JanDeDobbeleer commented 2 years ago

@carrotfarmer do you have the link? Just so that's it related.

carrotfarmer commented 2 years ago

yea sure: https://github.com/carrotfarmer/cubedeck https://github.com/carrotfarmer/blog-posts https://github.com/genicsblog/theme-files

JanDeDobbeleer commented 2 years ago

@carrotfarmer hmm, I can't reproduce this in iTerm, nor Hyper. I'm on the latest version of fish and only have the following line in my config:

oh-my-posh prompt init fish | source

image image
carrotfarmer commented 2 years ago

@JanDeDobbeleer Oh, I'm having the same issue after clearing out my config too... Do you have any idea why this could be happening? Is it something with my font? Because it's a nerd font (FiraCode Nerd Font) and it shouldn't cause any issues...

JanDeDobbeleer commented 2 years ago

@carrotfarmer do you have the latest fish version?

carrotfarmer commented 2 years ago

No, I'll try upgrading now

carrotfarmer commented 2 years ago

@JanDeDobbeleer Ah, I'm having the same issue with the latest version (3.4.0) too lol

karl-chanel commented 2 years ago

try a different font ,even the same nerd font ,we can still see a different redering , I don't really know why, But you can see the difference When you switch it

JanDeDobbeleer commented 2 years ago

@carrotfarmer the font can obviously have an influence on rendering, the extended background is a bug in ANSI rendering (but that can't just "happen", it needs to be reproducible). Did you tweak the theme a little bit? There might be something in your env that has ANSI escape sequences which ruins the rendering.

BTW, what is that initial symbol in your shell? That's not oh-my-posh.

carrotfarmer commented 2 years ago

@JanDeDobbeleer No, there are no such modifications in my configs. That symbol is vi mode for the shell, though this issue occurs even with vi mode disabled.

carrotfarmer commented 2 years ago

I'll try installing a new theme to see if there are glitches. Could just be the default theme's problem I guess...

carrotfarmer commented 2 years ago

@JanDeDobbeleer This issue isn't there with other themes, might be something with the default theme? Or could you try showing me the JSON config for the default theme?

carrotfarmer commented 2 years ago
image

I also tried it with this theme, which looks pretty similar to the default and it works fine too

JanDeDobbeleer commented 2 years ago

@carrotfarmer you can look have a look here.

karl-chanel commented 2 years ago
屏幕截图 2022-03-23 180938 屏幕截图 2022-03-23 181052

im sorry for not making it clear , what i mean is that i installed the codenewroman font(nerd font ) ,then i have several choices in the setting panel ,codenewroman nf renders like pic1,codenewroman nerd font mono renders like pic2, you can see the difference of the icon(not just happen in codenewroman ,cascaydiacove nerd font etc),i dont know the reason but the problem has been there for a long time and still exist,i didnt file an issue ,cause pic 1 works fine with me (pic 2 the icon is too small),ireally dont n why ,maybe it's a bug you dont realize or it's just natural, just telling you

karl-chanel commented 2 years ago
屏幕截图 2022-03-23 183420 屏幕截图 2022-03-23 183449

here is more comparison

carrotfarmer commented 2 years ago

@carrotfarmer you can look have a look here.

Yeah, it's a problem with the theme, ig. It still doesn't work.

JanDeDobbeleer commented 2 years ago

@carrotfarmer can you comment out segments until it doesn't happen anymore? Trying to find the culprit.

carrotfarmer commented 2 years ago

Yea

JanDeDobbeleer commented 2 years ago

@karl-chanel font rendering is never something oh-my-posh can influence (it even differs per shell, you can also see that in my screenshots above). It's not because the front have been patched with the same glyphs that they also render equally. oh-my-posh only outputs a set of characters and color indications using ANSI, it can't influence how the terminal renders that.

karl-chanel commented 2 years ago

@karl-chanel font rendering is never something oh-my-posh can influence (it even differs per shell, you can also see that in my screenshots above). It's not because the front have been patched with the same glyphs that they also render equally. oh-my-posh only outputs a set of characters and color indications using ANSI, it can't influence how the terminal renders that.

thanks ,vscode and wt did a great job in rendering the font (apart from what i mentioned above ),but jetbrains ides did poorly,hoping there will be a change in the future, anyway thank u for ur reply

JanDeDobbeleer commented 2 years ago

@karl-chanel we even have a FAQ item for that.

JanDeDobbeleer commented 2 years ago

@carrotfarmer I noticed that hyperlinks can break the rendering, I have a fix in #2001. This could be related.

JanDeDobbeleer commented 2 years ago

@carrotfarmer can you validate the latest release? We now have proper hyperlink parsing and character escaping

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

carrotfarmer commented 2 years ago

Sure @JanDeDobbeleer Sorry for the late response!

carrotfarmer commented 2 years ago

@JanDeDobbeleer I updated to version 7.61.0, and the issue still persists

JanDeDobbeleer commented 2 years ago

@carrotfarmer I've been using fish as my daily driver, can't reproduce this in any way.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

JanDeDobbeleer commented 2 years ago

@carrotfarmer I actually found a way to reproduce this which implies a non-escaped character (\c)

JanDeDobbeleer commented 2 years ago

@carrotfarmer can you try again?

github-actions[bot] commented 9 months ago

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.