On Mon, May 11, 2026 at 11:47 AM Chet Ramey <[email protected]> wrote:
>
> It's easy to do
>
> shopt -u checkwinsize
> : ${LINES:=24} ${COLUMNS:=80}
>
> if it matters, without having to wait for any changes to the shell. TheOP
> is already two major versions back.

Guess what I'm asking for would be more along the lines of this, at
least in bash 5.3:

if [[ -v COLUMNS || -v LINES ]]; then
  shopt -u checkwinsize
else
  ( : )
  trap '( : )' SIGWINCH
fi

Note that any script where COLUMNS or LINES in the environment is
relevant would have to have the first half of that right now.

With a modern env, I can even do:

#!/usr/bin/env --split-string=bash -i
set +o histexpand +o history +o monitor
shopt -u expand_aliases

And also get what I want, though there may be some downside I'm unaware of.

Even living in RHEL 7, I could just use a script or alias to call the
given script with those options set, come to think of it.

My work machine is six bash major versions back. I'd still rather
things improve at some point.

Reply via email to