Re: [PATCH] test: skip test with COLUMNS=1 under mksh

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] test: skip test with COLUMNS=1 under mksh

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:41

Zbigniew Jędrzejewski-Szmek [off-list ref] writes:
mksh does not allow $COLUMNS to be set below 12. Quoting mksh(1)
$COLUMNS is "always set, defaults to 80, unless the value as reported
by stty(1) is non-zero and sane enough". This applies also to setting
it directly for one command:

$ COLUMNS=30 python -c 'import os; print os.environ["COLUMNS"]'
30
$ COLUMNS=20 python -c 'import os; print os.environ["COLUMNS"]'
20
$ COLUMNS=10 python -c 'import os; print os.environ["COLUMNS"]'
98
I'd hate to say this, but that shell is broken.
Let's test if we can set COLUMNS=1, and if not, skip the tests that
want to use that. A prereq is added, which is set if $COLUMNS can be
set.
And I think that is a sensible workaround, even though COLUMNS_CAN_BE_1
might not be the best name for it.
+( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
This is different from what you wrote in your log message, but I trust
that it will fail under the problematic shell?

Will queue; thanks.

Re: [PATCH] test: skip test with COLUMNS=1 under mksh

From: Zbigniew Jędrzejewski-Szmek <hidden>
Date: 2016-06-15 22:53:41

On 04/27/2012 06:08 PM, Junio C Hamano wrote:
Zbigniew Jędrzejewski-Szmek [off-list ref] writes:
quoted
mksh does not allow $COLUMNS to be set below 12. Quoting mksh(1)
$COLUMNS is "always set, defaults to 80, unless the value as reported
by stty(1) is non-zero and sane enough". This applies also to setting
it directly for one command:

$ COLUMNS=30 python -c 'import os; print os.environ["COLUMNS"]'
30
$ COLUMNS=20 python -c 'import os; print os.environ["COLUMNS"]'
20
$ COLUMNS=10 python -c 'import os; print os.environ["COLUMNS"]'
98
I'd hate to say this, but that shell is broken.
Yes.
quoted
Let's test if we can set COLUMNS=1, and if not, skip the tests that
want to use that. A prereq is added, which is set if $COLUMNS can be
set.
And I think that is a sensible workaround, even though COLUMNS_CAN_BE_1
might not be the best name for it.
quoted
+( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
This is different from what you wrote in your log message, but I trust
that it will fail under the problematic shell?
Yes.
Will queue; thanks.
Cool.

Zbyszek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help