We have this bug where if the url is wider than the terminal, the spinner will constantly wrap to a newline and flood the console. I'd like for us to trim the url instead so everything stays on one line.
We can measure the size of the terminal with this package (if a user resizes the terminal while things are running all bets are off I reckon).
Instead of just trimming off the end of the url i'd like for us to insert ... somewhere in the middle so https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.10.tgz might become https://registry.npmjs.org/@esbuild/.../darwin-arm64-0.19.10.tgz for example. I'm not sure what the right heuristic is for working out what bits to drop, maybe splitting by segment and dropping some from the middle?
We have this bug where if the url is wider than the terminal, the spinner will constantly wrap to a newline and flood the console. I'd like for us to trim the url instead so everything stays on one line.
We can measure the size of the terminal with this package (if a user resizes the terminal while things are running all bets are off I reckon).
Instead of just trimming off the end of the url i'd like for us to insert
...
somewhere in the middle sohttps://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.10.tgz
might becomehttps://registry.npmjs.org/@esbuild/.../darwin-arm64-0.19.10.tgz
for example. I'm not sure what the right heuristic is for working out what bits to drop, maybe splitting by segment and dropping some from the middle?