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

Using a custom powerline theme breaks command line when pasting text and moving the cursor #641

Open
moshpirit opened this issue Dec 9, 2024 · 2 comments

Comments

@moshpirit
Copy link

I have a custom theme based on Powerline (link to the theme files on my nextcloud account). When I paste anything on the terminal, it breaks the command. In this case, let's say I want to play a youtube link with mpv, if I type mpv <url> and move the cursor back (with any terminal), I get this:
imagen
It seems like the characters 'ht are duplicated, but it actually displaced the three first characters to the right; in reality there's something more like this:
imagen
What am I missing and how can I fix it?

@akinomyoga
Copy link
Contributor

This typically happens when the character width schemes that your shell (Bash/Readline) and terminal assume mismatch.

@akinomyoga
Copy link
Contributor

So one needs to adjust the character width scheme of either the shell or the terminal.

If your terminal allows specifying the character widths of glyphs from Nerd Fonts, you should configure it. Or you may request the developer of the terminal to support the character widths of glyphs from Nerd Fonts.

If it's not possible, another possibility would be to define your own locale modifier such as @terminal_wcwidth with proper character width definitions and to specify a custom locale e.g. LANG=en_US.UTF-8@terminal_wcwidth so that Bash/Readline calculates the character widths based on this custom locale. However, this would require expertise in system locale definitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants