Line-wrap breaks detected links #12476

Closed
opened 2026-01-31 03:16:42 +00:00 by claunia · 3 comments
Owner

Originally created by @Just-Insane on GitHub (Feb 9, 2021).

Environment

Windows build number: 10.0.18362.0
Windows Terminal version (if applicable): 1.5.10271.0

Any other software? Tested in PowerShell, haven't tried WSL or CMD, using a Format-Table with and without the -Wrap parameter.

Steps to reproduce

When a URL is shown on the terminal that is longer than the width of the window, it is either wrapped or truncated to fit to the width of the window. Both wrapped and truncated links are clickable (due to the initial http/https:// section, presumably), however, parameters might be cut off when ctrl+clicking on the links to open them in the browser.

Expected behavior

Ctrl+clicking on a link should always open the full URL as passed into the terminal output.

Actual behavior

The end of the URL is not included when ctrl+clicking on the link.

Originally created by @Just-Insane on GitHub (Feb 9, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.18362.0 Windows Terminal version (if applicable): 1.5.10271.0 Any other software? Tested in PowerShell, haven't tried WSL or CMD, using a Format-Table with and without the -Wrap parameter. ``` # Steps to reproduce When a URL is shown on the terminal that is longer than the width of the window, it is either wrapped or truncated to fit to the width of the window. Both wrapped and truncated links are clickable (due to the initial http/https:// section, presumably), however, parameters might be cut off when ctrl+clicking on the links to open them in the browser. # Expected behavior Ctrl+clicking on a link should always open the full URL as passed into the terminal output. # Actual behavior The end of the URL is not included when ctrl+clicking on the link.
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 03:16:42 +00:00
Author
Owner

@DHowett commented on GitHub (Feb 9, 2021):

Sorry, I am not sure I understand. The region that is underlined is the region whose text is copied into the hyperlink activation when you ctrl+click on the link.

If the link is truncated by the application, the parameter data is lost and can never be recovered. Likewise if the application manually wraps the text (by inserting a hard newline in it) then we cannot complete the link as the application has told us that it's broken in the middle.

Terminal doesn't truncate text unless it is pushed off the top of the scrollback buffer during a resize, and even then that would prefer to delete the beginning of the link, not the end.

Do you have an example of the behavior you're experiencing?

@DHowett commented on GitHub (Feb 9, 2021): Sorry, I am not sure I understand. The region that is underlined is the region whose text is copied into the hyperlink activation when you ctrl+click on the link. If the link is truncated by the application, _the parameter data is lost and can never be recovered_. Likewise if the application manually wraps the text (by inserting a hard newline in it) then we cannot complete the link as the application has told us that it's broken in the middle. Terminal doesn't truncate text unless it is pushed off the top of the scrollback buffer during a resize, and even then that would prefer to delete the _beginning_ of the link, not the end. Do you have an example of the behavior you're experiencing?
Author
Owner

@Just-Insane commented on GitHub (Feb 9, 2021):

Ah, you're correct.

By default PowerShell limits table output to the width of the window, which makes sense.

I was able to find a solution from this StackOverflow thread, using the Format-Table | Out-String -Stream -Width <int> option seems like it will work best for me.

Though, manually setting the BufferWidth before and after output ([console]::BufferWidth = <column-count>) would also work.

I'm going to close this, as it is not an issue with the Terminal.

@Just-Insane commented on GitHub (Feb 9, 2021): Ah, you're correct. By default PowerShell limits table output to the width of the window, which makes sense. I was able to find a solution from this [StackOverflow thread](https://stackoverflow.com/a/38576389), using the `Format-Table | Out-String -Stream -Width <int>` option seems like it will work best for me. Though, manually setting the BufferWidth before and after output (`[console]::BufferWidth = <column-count>`) would also work. I'm going to close this, as it is not an issue with the Terminal.
Author
Owner

@DHowett commented on GitHub (Feb 10, 2021):

So, one thing PowerShell could do is use OSC 8 to glue the hyperlinks back together. It's a control sequence that lets an application tell a terminal that multiple different runs of text are logically part of the same link. It's intended to be used for this exact scenario. 😄

@DHowett commented on GitHub (Feb 10, 2021): So, one thing PowerShell could do is use `OSC 8` to glue the hyperlinks back together. It's a control sequence that lets an application tell a terminal that multiple different runs of text are logically part of the same link. It's intended to be used for this exact scenario. :smile:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12476