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

prompt shows ... if there are emojis in item output or directory names #134

Closed
mknj opened this issue Mar 29, 2021 · 3 comments
Closed

prompt shows ... if there are emojis in item output or directory names #134

mknj opened this issue Mar 29, 2021 · 3 comments
Labels
🐛 bug Something isn't working 🏞️ upstream Due to upstream constraints
Milestone

Comments

@mknj
Copy link

mknj commented Mar 29, 2021

Describe the bug

The beginning of the prompt is messed up if there are emojis in the prompt line

Steps to reproduce

Run mkdir "dirname containing emoji (🐛)"; cd dir*

Expected behavior

The first character of the prompt does not change

Screenshots

image

Environments

  • Microsoft WSL running "18.04.1 LTS (Bionic Beaver)" + Microsoft Terminal
  • Ubuntu 20.10 + gnome-terminal
fish, version 3.2.1
tide, version 4.3.2
xterm-256color

Additional context

This is really annoying if you try to put colored emojis in your item. i.e.
image

@mknj mknj added the 🐛 bug Something isn't working label Mar 29, 2021
@mknj
Copy link
Author

mknj commented Mar 29, 2021

The ellipsis vanishes when resizing the window, but it is displayed again when entering commands.

@IlanCosman
Copy link
Owner

The problem is that I've been using string length as a proxy for string width.

@faho Could you help me out?

function foo -a char
    set -l stringLength (string length "$char")
    
    echo $stringLength
    
    printf '%s' $char
    string repeat --max (math $COLUMNS - $stringLength) -
end

string-length-emojis

Is there any way to have string length use the values of fish_emoji_width/fish_ambiguous_width? Or otherwise calculate the width of a string?

@faho
Copy link

faho commented Mar 29, 2021

Is there any way to have string length use the values of fish_emoji_width/fish_ambiguous_width? Or otherwise calculate the width of a string?

No. It's length, not width. fish-shell/fish-shell#4012 asks for a string width subcommand.

@IlanCosman IlanCosman added the 🏞️ upstream Due to upstream constraints label Mar 29, 2021
@IlanCosman IlanCosman added this to the future milestone Mar 29, 2021
@IlanCosman IlanCosman modified the milestones: future, v5.0.0 Apr 22, 2021
@IlanCosman IlanCosman modified the milestones: future, v5.1.0 Oct 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working 🏞️ upstream Due to upstream constraints
Projects
None yet
Development

No branches or pull requests

3 participants