[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNU Parallel Bug Reports --tmux does not pass locale correctly (need
From: |
Ole Tange |
Subject: |
Re: GNU Parallel Bug Reports --tmux does not pass locale correctly (needed since tmux 2.2) |
Date: |
Sun, 16 Apr 2017 13:49:04 +0200 |
On Sat, Apr 15, 2017 at 9:04 PM, Matti Niemenmaa
<address@hidden> wrote:
> --tmux doesn't work for me at all as of tmux 2.2. The "Maximal used size of
> command" is computed incorrectly and so no command can be run:
>
> $ parallel --tmux --show-limits echo ::: x
> Maximal size of command: 131049
> Maximal used size of command: -16
Yup, it is clearly wrong.
> $ LANG= LC_ALL= LC_CTYPE= tmux
> tmux: need UTF-8 locale (LC_CTYPE) but have ANSI_X3.4-1968
I compiled 2.3 from source and could not reproduce this.
> The underlying cause within GNU parallel is that ::qqx is used to call tmux,
> and ::qqx strips out locale information from the environment.
>
> Note that everything will seem to work if you have the en_US.UTF-8 locale
> available, because tmux will fall back to that in the absence of locale
> information. On my system that locale is not installed, which culminates in
> the failure.
>
> Adding LC_CTYPE to @keep inside ::qqx fixes the issue.
I am reluctant to copy $LC_CTYPE as I need the output from ::qqx to be
predictable, and locales can change the output.
So I suggest:
@@ -4228,6 +4228,7 @@ sub qqx {
@address@hidden = @address@hidden;
local(%ENV);
%ENV = %env;
+ $ENV{'LC_ALL'} = 'C';
if($Global::debug) {
return qx{ @_ && true };
} else {
Will this work, too?
(And if you can find a virtual machine image on which you can
reproduce the error, please let me know.)
/Ole