dmenu doesn't work as expected
Created by: bb010g
Reproduction:
Run the following script with no arguments and press enter when prompted:
#!/usr/bin/env ion
echo $join(@args[1..], "|")
let foo = $(dmenu @args[1..])
let foo = $(echo hi | dmenu @args[1..])
echo got foo
ion -c "echo "$foo | /usr/bin/cat
ion -c "echo "$foo | dmenu @args[1..]
echo $foo | dmenu @args[1..]
Expected behavior:
I'd expect it to work equivalently to this dash script:
#!/usr/bin/env dash
(IFS="|"; echo "$*")
foo="`dmenu "$@"`"
foo="`echo hi | dmenu "$@"`"
echo got foo
dash -c "echo "$foo | /usr/bin/cat
dash -c "echo "$foo | dmenu "$@"
echo $foo | dmenu "$@"
The output will first be a blank line followed by execution stopping as dmenu waits for input. Enter a line and press ^D
to make it prompt you and keep going. foo
will get hi
assigned to it. got foo
will be printed, followed by hi
three times.
Actual behavior:
Ion will cause dmenu to show up with no choices. Type bar
, press enter, and Ion presents a proper dmenu with hi
as the choice. got foo
and hi
will be printed, followed by:
usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]
[-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]
usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]
[-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]
The script exits with 1.
Build information: [output of rustc -V
, git rev-parse HEAD
, qemu-i386 -version
, uname -a
, etc.]
rustc 1.19.0 (0ade33941 2017-07-17)
HEAD: 3319ffb00e3ff54db1446302a7debd7e7f7ff893
Linux bb010g-lat 4.12.8-1-ARCH #1 SMP PREEMPT Thu Aug 17 08:37:20 CEST 2017 x86_64 GNU/Linux
dmenu -v: dmenu-4.7
Blocking/related: Maybe #424 (closed)? I'm not sure here.