terminal icon indicating copy to clipboard operation
terminal copied to clipboard

URL highlight broken when URL ends at the EOL

Open bestis opened this issue 1 year ago • 3 comments

Windows Terminal version

1.19.10821.0

Windows build number

10.0.22631.3447

Other Software

No response

Steps to reproduce

  • Open Ubuntu terminal
  • Set your terminal to X cols
  • Run these echo's so that the amount of spaces make the middle one end in the EOL
echo 'https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing'
echo '                 https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing'
echo '                  https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing'
  • Open Windows Powershell

  • Run similar echos

  • Open Command Prompt

  • Run similar echos without the quotes.

Expected Behavior

All the links open the right webpage.

Actual Behavior

  • Ubuntu, the middle link looses the last letter. image
  • Powershell, the middle link gets extra PS in the end. image
  • Command prompt, middle link looses the last letter image

bestis avatar Apr 16 '24 11:04 bestis

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Apr 16 '24 11:04 github-actions[bot]

My example has no emoji, wide-characters, etc. So doesn't seem related to me.

bestis avatar Apr 16 '24 11:04 bestis

This likely occurs because the UTextAdapter.cpp code doesn't insert newlines between rows. This only becomes apparent when there's a newline at the exact end of the row because then there's no separator between the match (URL) and the remaining text.

lhecker avatar Apr 17 '24 17:04 lhecker