Skip to content
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

PyCharm terminal broken by right prompt item #476

Open
rpop0 opened this issue Jan 4, 2024 · 17 comments · May be fixed by #515
Open

PyCharm terminal broken by right prompt item #476

rpop0 opened this issue Jan 4, 2024 · 17 comments · May be fixed by #515
Labels
🐛 bug Something isn't working

Comments

@rpop0
Copy link

rpop0 commented Jan 4, 2024

Describe the bug

The whole terminal in pycharm seems to get broken when using a right prompt item.

Steps to reproduce

  1. Have right prompt items enabled.
  2. Open a terminal in PyCharm
  3. Terminal is broken.

Screenshots

image

Environment

Output of tide bug-report:

fish version: 3.6.0
tide version: 6.1.1
term: xterm-256color
os: macOS Sonoma
terminal emulator: Pycharm integrated
fish startup: 8.13 millis
fisher plugins: jorgebucaran/fisher edc/bass ilancosman/tide@v6

Additional context

N/A

@rpop0 rpop0 added the 🐛 bug Something isn't working label Jan 4, 2024
@jamesanto
Copy link

I am seeing the same issue. I tried disabling Shell Integration as well. It didn't help.

@rpop0
Copy link
Author

rpop0 commented Jan 9, 2024

This seems to happen only on MacOS, when I tried it on windows it was fine.

@atrepczik
Copy link

Same here on Ubuntu 22.04, reverting to v5 works around the problem

@MaxSchambach
Copy link

I'm facing the same issue on macOS and PyCharm 2023.3.3.
Any ideas on how to solve or hotfix this?

@keplian
Copy link

keplian commented May 25, 2024

Same issue. But works fine when "python" item is removed from right promt

@StefanLobbenmeierObjego

in my case it was not python but kubernetes. I suspect several items are affected then.

I replaced the emoji with a dot like this: set --universal tide_kubectl_icon . and that seems to do the trick 😄

@HAOCHENYE
Copy link

For me, the unexpected icon is tide_python_icon. Set it to . save me 🤣

@pieterrombauts
Copy link

It seems like [email protected] was using the Unicode Helm Symbol for kubectl before switching to the Nerd Font Kubernetes icon (U+F10FE). Similarly, the Python symbol is now also a Nerd Font icon.

I believe this may be caused by the Jetbrains terminal not handling some Nerd Font characters correctly? Considering the prompt works fine in iTerm with the same icons, it seems likely that Jetbrains is to blame, probably due to handling ambiguous-width characters as double-width.

In the mean time, setting tide_kubectl_icon to the Unicode Helm symbol seemed to work, and setting tide_python_icon to another Python NF icon (U+E73C) seems to work better — this one may not be treated as ambiguous width by Jetbrains, I'm not entirely sure.

@StefanLobbenmeierObjego

The python icon is also broken in my iterm, maybe I have to update the font to use it?
image

But I went ahead and looked up the icons @pieterrombauts mentioned so it is hopefully possible to just copy paste them:

# Python: copied from https://www.unicodepedia.com/unicode/private-use-area/e73c/private-use-area-e73c/
set --universal tide_python_icon 

# Kubernetes: copied from https://www.unicodepedia.com/unicode/miscellaneous-technical/2388/helm-symbol/
set --universal tide_kubectl_icon ⎈

@StefanLobbenmeierObjego
Copy link

StefanLobbenmeierObjego commented Jul 25, 2024

Anyone here has any other icons they had issues with?
Also could someone test the linked PR on Linux?

fisher remove ilancosman/tide@v6
fisher install StefanLobbenmeierObjego/tide@patch-1
Then reconfigured, enabled "Show many Icons":
tide configure --auto --style=Lean --prompt_colors='True color' --show_time='24-hour format' --lean_prompt_height='One line' --prompt_spacing=Compact --icons='Many icons' --transient=No

@sandersteenhoudt
Copy link

@StefanLobbenmeierObjego The alternative icons from your PR work for me on Arch Linux, the terminal in IntelliJ behaves properly!

@pieterrombauts
Copy link

I feel a bit hesitant to immediately revert the icons to once that avoid the issue in Jetbrains since the current icons are nicer in my opinion (like using the real Kubernetes logo instead of a generic ship steering wheel). Ideally, Jetbrains should fix their terminal implementation to support the Nerd Font icons, but they have a very old issue that doesn't seem to be high priority. I don't think Tide should have to decrease the user experience for the majority of users that use this prompt with other terminals that have implemented proper Nerd Font support.

Maybe a better solution for this would be to have an additional step in the configuration process to opt to disable Nerd-Font icons, and instead use generic single-width unicode icons instead.

@sandersteenhoudt
Copy link

@pieterrombauts I agree, @StefanLobbenmeierObjego's PR is a workaround for a bug that JetBrains should fix in their products, not a bug with Tide or its icons. I would also much rather use the default icons and I think they should not be replaced just so JetBrains IDEs play nice with them. However, having a non-functional terminal in your IDE is a PITA, so at the very least it's nice to know this workaround exists.

@StefanLobbenmeierObjego
Copy link

StefanLobbenmeierObjego commented Jul 26, 2024

I see, upvoted the linked youtrack issue, maybe we can get the ball rolling there 😄 i can understand that this project does not want to work around the intellij bug, so for me it is fine to just revert the icons manually.

The python icon is also broken in my iterm, maybe I have to update the font to use it?

I could also confirm that iTerm handles the new icons correctly after installing the fonts again

@UncleGoogle
Copy link

I have the same issue outside of Pycharm (using vscode terminal) when entering to directory containing Python repository.

Workaround: I made my prompt 2line+transient and now works acceptable (I still produces 2 color prompt lines on enter)

@montaro
Copy link

montaro commented Nov 3, 2024

Thanks for the inspiring comments, I copied the Python icon from the Nerd Fonts icons cheatsheet and set it universally to the variable tide_python_icon and PyCharm Terminal is happier now!

@kazie
Copy link

kazie commented Dec 7, 2024

I just had the same problem.

My problem was the icon that it was showing, and I changed it to the emoji 🐍 (as I was working in a python project) and now it works.

set --universal tide_python_icon 🐍

And now it works.


I want to thank everybody for sharing info about this here, so I could apply a workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.