betterer icon indicating copy to clipboard operation
betterer copied to clipboard

CLI output auto-wraps at 76 chars breaking native file path linking

Open ChillyBots opened this issue 1 year ago • 1 comments
trafficstars

Describe the bug In VSCode, typically when a file path is logged to the console, you can ctrl+click it and open it. However, Betterer (or the underlying commander package) is forcefully breaking lines rather than using all available terminal line space and letting the terminal wrap it naturally. This breaks any file path links. Notice how only the first section is underlined on ctrl+hover:

To Reproduce ctrl+click any file path in betterer cli output

Expected behavior should open file correctly

Screenshots image

Versions (please complete the following information):

  • OS: Win11 / WSL 2 / ZSH 5.8.1
  • Betterer Version [e.g. 4.*] ^5.4.0
  • Node Version [e.g. 14.*] v20.12.1

ChillyBots avatar Aug 15 '24 09:08 ChillyBots

So this is a really tricky one - it seems like it only happens in some situations are I can't really work out how or why? Are you able to share how to get it happening consistently? Ink doesn't currently expose a way to change this anyway - so I'll consider that one more reason to move away from Ink in the future.

It may be that I had already improved things in my v6 branch (Coming Soon™) but either way, I've tried to improve this further by always removing the cwd from the rendered output. Relative paths still work, and they're mostly shorter so hopefully the line wrapping doesn't impact it as much.

Check out #1215 for the PR where I tried to make a bunch of reporting stuff better, but it's pretty noisey 🙃

phenomnomnominal avatar Sep 15 '24 03:09 phenomnomnominal