But yeah, agree. It's way more preferable to have surprise output on stderr than surprises mingling with stdout, and it's good to be prepared for that.
Frankly, I nearly quit piping to a pager when GUI terminal backscroll became easy and infinite.
But yeah, agree. It's way more preferable to have surprise output on stderr than surprises mingling with stdout, and it's good to be prepared for that.
Frankly, I nearly quit piping to a pager when GUI terminal backscroll became easy and infinite.
80x25
> I set all my terminals to 22x23.
You are a very silly man and silliness should not be catered for.
> Will --help run a few quick ioctls to calculate screen size?
Your terminal can wrap text around just fine. If it can't, ask for refund.
Also my father produced tonnes of scratch paper in narrow strips. I found a way to weave them into a perpetually-growing "tractor-feed snake" which I placed in a padded crib and brought to grade school to show off. I would typically juggle a few bits and bobs to attract even more attention...
I'm sure you could dig around into my hometown's landfill for awhile. They're only 30 years sediment. I'll send you a tarp, shovel, duct tape to stick the pages back together, and my sister's old clothes to wear while you work. DM for deets.
tool [args] 2>&1 | less
Presumably "less" knows how big your terminal is. tool 2>&1 | less
can be replaced by tool |& less $ /bin/bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin21)
on the off chance anyone was curious/didn't remember. Yes, I have $HOMEBREW_PREFIX/bin/bash and it's 5.2.15In that same vein, I wondered if that syntax was supported in zsh since modern macOS went whole hog and ... I gained one more pebble on the huge pile of steaming turds why I detest zsh
$ /bin/zsh -exc '{ echo alpha; echo beta; } |& wc -l'
+zsh:1> wc -l
4
dafuq? $ /bin/zsh -exc '{ echo alpha; echo beta; } |& cat'
+zsh:1> cat
+zsh:1> echo alpha
alpha
+zsh:1> echo beta
beta
oh, aren't you just the funniest. har. de. har. XTRACE (-x, ksh: -x)
Print commands and their arguments as they are executed.
So if you use "zsh -ec" does it still surprise you?-x is the most invaluable tool in my shell-debugging toolkit. It is great to see every command evaluated and run alongside the script output itself. I use it multiple times per day at work.
Alternatively, tools could build in pagers for fewer pipeline surprises, like the all-encompassing systemd.
Even better, I could envision a framework where any tool that produces output can be automatically subject to pagination, with auto terminal detection and the whole bit. Think of libreadline but for output. You could thereby eliminate plenty of ad hoc hacks.