Search code examples
shellterminalwgetcolumn-width

How can I tell wget to use only 80 characters for its progressbarr when the terminal window is wider then that


In a terminal which is a lot wider than 80 columns wget uses the full width for its progress bar. How can I tell it to use only 80 characters?

In the calling shell I tried

export COLUMNS=80

and

stty cols 80

Both does not seem to affect wget.

PS: I use wget 1.20.3 installed via brew on macOS, but I think this will be applicable to other unix-ish environments as well.


Solution

  • If the stty bit you tried doesn't do the trick, you likely can't.

    With the bar style progress meter, if standard error is a terminal, it is queried for its width, and that is used. (See determine_screen_width() in utils.c for how that's done). If that fails, a hard coded width of 80 is used (DEFAULT_SCREEN_WIDTH in progress.c). It doesn't check environment variables or have another way for the user to manually specify a width.