-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
New nodejs character positioned incorrectly #2546
Comments
For others encountering this, the config workaround is: [nodejs]
symbol = "⬢ " |
Thanks for reporting. Which font do you use? |
I tried a few from the latest release (2.1.0), all with the same result. Here are their names as they appear in macOS’ Font Book:
The one in the screen shot is RobotoMono Nerd Font Mono – Medium. |
reference: starship/starship#2546 Signed-off-by: Chawye Hsu <chawyehsu@hotmail.com>
@andytom, I thought I'd pick up this issue for Hacktoberfest 🎃, but can't seem to reproduce it. I used a Dockerfile to reproduce the target environment, as I don't own any devices that run OS X. I'm running on Fedora 33, so for glibc compatibility, I created a Fedora-based container: FROM fedora:latest
COPY ./target/debug/starship /usr/local/bin/starship
RUN dnf -y update && \
dnf install -y curl wget git zsh && \
useradd -ms /usr/bin/zsh -u 1001 starship && \
curl -fsSL https://rpm.nodesource.com/setup_16.x | bash - && \
dnf install -y nodejs && \
dnf clean all && \
rm -rf /var/cache/yum
WORKDIR /home/starship
USER 1001 Commands run: # From the starship repo root
docker build -f Dockerfile -t starshiptest .
docker run -it --rm starshiptest
# Inside the container
zsh
eval "$(starship init zsh)"
git clone https://github.com/mqttjs/MQTT.js.git
cd MQTT.js I pulled Roboto Mono from NerdFonts and switched my personal terminal to it. Things seem to be working as expected: I'm willing to pitch in and help if there's still a change needed. |
@Overflow0xFFFF This is going to depend on terminal emulator being used in addition to possibly shell, OS, and font (depending on exactly which combinations of things are being used). #3150 seems to suggest that this bug is still seen with the default MacOS terminal, but I don't know if it'd be seen anywhere else. You'd probably want a very simple terminal that doesn't do a lot of adapting to wcswidth, maybe xterm, urxvt, or st would be good candidates (but I don't know for sure). |
@chipbuster: Thanks for the heads up! I did some more testing on Fedora 33. |
Maybe you can try with kitty as that's cross platform. I see the bug with kitty and fish shell on macOS 11.4 using an Ubunto mono nerdfont: Top is the default (i.e. the bug, though it no longer seems to be colliding), bottom is with my config applied: |
I suspect the difference in rendering between the node.js symbol and (for example) the git branch symbol, is that kitty will render a glyph a different size depending on, amongst other things, the amount of spaces after it: kovidgoyal/kitty#2672. This does not affect the git branch icon (maybe because it is already tall), but for the node.js icon it will render small if there is no space after it: and larger if there is one space after it: So the icon size is basically not static. Which leads to the discrepancy we're seeing for the node.js glyph. Starship prints a space after the node.js glyph, which is eaten up by the glyph increasing in size, instead of being used as whitespace between the glyph and the version string. |
I installed kitty and applied the config mentioned earlier in the thread to change the symbol back to a hexagon just to compare: I'm using the RobotoMono Nerd Font used in the original issue. Tested with kitty v0.21.2. Likewise, for the record, I'm running Fedora 33 with a GNOME desktop and I'm using xorg, not wayland. |
Strange. Maybe it's platform related? I wonder if anyone else can reproduce it on macos. |
On macOS, the bug occurs on Apple's default Terminal.app, but not on iTerm2. (Using Fira Code Nerd Font in both terminals, but seems to be independent of used font) Update: |
Left: MacOS Terminal. Middle: iTerm2. Right: kitty. MacOS Terminal has some pretty fun issues with emoji fonts. Consider the following image: Here's what it looks like in iTerm2: Note that iTerm2 has shrunken and shifted so that all emojis are displayed. There are also some emoji sequences where both terminals screw up horrendously: consider the following 5 (yes, 5!) character sequence: iTerm2 doesn't really do any better on this one. If you want to try this on your own platform, here's the emoji string I used to test with: ⭐️🕝🎯☘🚼🚐⚓️🍰🎻🏠🌟🎈📡 |
For anyone being affected by this: we used to have two spaces after the nodejs symbol to avoid this problem. However, at some point, we got rid of this because it didn't work and also broke other terminals. (I am unable to locate the PR at the moment). We can use a similar setting to undo the overlap issue. It gives us a slightly spaced out prompt, but the character overlapping is gone: So as I see it, you have four options: Options for a fix
|
I use kitty on macos and have this problem as well. So I don't think the above suggestion (i.e. moving to kitty) will fix it if my personal setup is anything to go by. It's not just the macos default terminal.app that's having this problem. As mentioned here: #2546 (comment) |
@ismay Kitty for me on macOS renders this properly. No clue what the difference could be. |
That's strange, and yeah me neither. Ah well 🤷♂️ |
@ismay Would you be comfortable sharing your kitty.conf so we can test if that affects this in any ways? Also, what version of MacOS are you running, and is it Intel or Apple? |
Sure no problem. My kitty overrides are here: https://github.com/ismay/dotfiles/blob/main/config/kitty/kitty.conf (as well as my other configuration). I'm running macOS 11.4 on an early 2015 Intel MBP. |
@ismay No idea what to make of this.
I've copied everything from your repo at macbook/config into my I appear to have the exact same setup as you do, but things look pretty much fine here. Is it possible that differences in the version of the font somehow cause this? EDIT: One thing I do notice is that the arrow emoji use as the character doesn't display properly in iTerm2 at all. |
Strange. Well might just be linked to the exact state my laptop was at at that time. I'd be fine with closing as resolved until we can find a reliable way to reproduce. |
should we change the default of symbol to e718? currently it is f898, after adding following config in starship.toml. [nodejs]
symbol = " " |
Huh. That's a surprisingly simple solution. I'd want to see that tested on other OS/terminal combos, but if that works in general I'd be happy to merge it. |
I will test it on other popular terminal. |
Bug Report
Current Behavior
The prompt for nodejs directories uses a new nerd-font character that does not render correctly. It’s positioned incorrectly and results in a collision with neighboring characters.
Expected Behavior
The nodejs character should not collide with neighboring characters.
Additional context/Screenshots
Possible Solution
Revert #1649.
Environment
Relevant Shell Configuration
Starship Configuration
The text was updated successfully, but these errors were encountered: