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

Whitespace Issues with prompt, on VSCode's integrated terminal #79175

Closed
pradyunsg opened this issue Aug 15, 2019 · 6 comments
Closed

Whitespace Issues with prompt, on VSCode's integrated terminal #79175

pradyunsg opened this issue Aug 15, 2019 · 6 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@pradyunsg
Copy link

Issue Type: Bug
Component: Integrated Terminal


A picture's worth a 1000 words, so here are 2 pictures. :)

VS Code Integrated Terminal:

Screenshot 2019-08-15 at 4 16 41 PM

MacOS's Terminal:

Screenshot 2019-08-15 at 4 07 37 PM

The main difference is when there's an RPROMPT, VS Code's Integrated Terminal does not seem to properly render/add the space that's at the end of the PS1. Both are using the same zsh executable, with the same "Iosevka Nerd Font".

Copy Pasted Text, from these sessions

VS Code:

     echo "this is good" && show
this is good
PS1 = b'%{\x1b[35;1H%}%{\x1b[38;5;255m%}%{\x1b[48;5;26m%}%{\x1b[38;5;255m%}  \xef\x80\x95  %{\x1b[38;5;26m%}%{\x1b[48;5;76m%}\xee\x82\xb0%{\x1b[38;5;228m%}%{\x1b[48;5;76m%}%{\x1b[39;49m%}%{\x1b[38;5;76m%}\xee\x82\xb0%{\x1b[39;49m%} '
RPROMPT = b''
     sleep 1                    
    echo "this is bad" && show                                                                                                                                                         1.018 
this is bad
PS1 = b'%{\x1b[35;1H%}%{\x1b[38;5;255m%}%{\x1b[48;5;26m%}%{\x1b[38;5;255m%}  \xef\x80\x95  %{\x1b[38;5;26m%}%{\x1b[48;5;76m%}\xee\x82\xb0%{\x1b[38;5;228m%}%{\x1b[48;5;76m%}%{\x1b[39;49m%}%{\x1b[38;5;76m%}\xee\x82\xb0%{\x1b[39;49m%} '
RPROMPT = b'%{\x1b[38;5;167m%}\xee\x82\xb2%{\x1b[38;5;255m%}%{\x1b[48;5;167m%} 1.018 %{\x1b[39;49m%}'
     which show                 
show: aliased to python3 -c "print('PS1 =', '${PS1}'.encode('utf-8')); print('RPROMPT =', '${RPROMPT}'.encode('utf-8'))"

MacOS Terminal:

     echo "this is good" && show
this is good
PS1 = b'%{\x1b[25;1H%}%{\x1b[38;5;255m%}%{\x1b[48;5;26m%}%{\x1b[38;5;255m%}  \xef\x80\x95  %{\x1b[38;5;26m%}%{\x1b[48;5;76m%}\xee\x82\xb0%{\x1b[38;5;228m%}%{\x1b[48;5;76m%}%{\x1b[39;49m%}%{\x1b[38;5;76m%}\xee\x82\xb0%{\x1b[39;49m%} '
RPROMPT = b''
     sleep 1                    
     echo "this is good" && show                                                                                                                                 1.015 
this is good
PS1 = b'%{\x1b[25;1H%}%{\x1b[38;5;255m%}%{\x1b[48;5;26m%}%{\x1b[38;5;255m%}  \xef\x80\x95  %{\x1b[38;5;26m%}%{\x1b[48;5;76m%}\xee\x82\xb0%{\x1b[38;5;228m%}%{\x1b[48;5;76m%}%{\x1b[39;49m%}%{\x1b[38;5;76m%}\xee\x82\xb0%{\x1b[39;49m%} '
RPROMPT = b'%{\x1b[38;5;167m%}\xee\x82\xb2%{\x1b[38;5;255m%}%{\x1b[48;5;167m%} 1.015 %{\x1b[39;49m%}'
     which show                 
show: aliased to python3 -c "print('PS1 =', '${PS1}'.encode('utf-8')); print('RPROMPT =', '${RPROMPT}'.encode('utf-8'))"

VS Code version: Code 1.37.0 (036a6b1, 2019-08-08T01:22:37.660Z)
OS version: Darwin x64 18.6.0
Extensions: none

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz (8 x 2500)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.55GB free)
Process Argv -psn_0_602259
Screen Reader no
VM 0%
@Tyriar
Copy link
Member

Tyriar commented Aug 15, 2019

The issue is the emoji, tracked in xtermjs/xterm.js#1709

@Tyriar Tyriar closed this as completed Aug 15, 2019
@Tyriar Tyriar added the *duplicate Issue identified as a duplicate of another issue(s) label Aug 15, 2019
@pradyunsg
Copy link
Author

pradyunsg commented Aug 19, 2019

That character is not an emoji. It's nf-fa-home from NerdFonts.

Removing it from the prompt, the issue still occurs:

Screenshot 2019-08-19 at 6 26 50 PM

This prompt has been working for me, since before the July update and that issue is a lot older than that.

@pradyunsg
Copy link
Author

(for folks following via email, I added more information to the comment above)

@Tyriar
Copy link
Member

Tyriar commented Aug 19, 2019

@pradyunsg the problem isn't restricted to just emoji but other ambiguous width unicode characters as well.

@pradyunsg
Copy link
Author

nods That makes sense.

Would it be possible for you to look into/provide pointers to what change might have affected this, between the June and July releases? I am more than willing to volunteer my time to help resolve this issue.

I can confirm that June release works well for me -- I've downgraded for now.

@Tyriar
Copy link
Member

Tyriar commented Aug 21, 2019

It's a pretty involved issue that will probably eventually be tackled by @jerch, lots of history you can read on xtermjs/xterm.js#1709 and linked issues/prs.

@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants