When a string is put in a shell variable, white-space loses its
syntactical information.
Merely quoting $CHROMIUM_FLAGS in the launcher won't do, since we rely
on word splitting to split arguments, as noted in #3.
The launcher has a #!/bin/sh shebang, so it's meant as a POSIX compliant
shell script. As such, we don't have access to arrays, which are a Korn
shell extension, _except_ for the argument list, which can be used as
one.
So I see two reasonable options here, and both are backwards-compatible,
i.e., won't upset users who are fine with the current state of
CHROMIUM_FLAGS.
>> OPTION 1 (already works in the current state of things) <<
Leave the launcher alone and instead instruct the user to abandon
CHROMIUM_FLAGS and take advantage of the argument list by writing this
~/.chromium-browser.init:
set -- --enable-logging=stderr --user-agent='A B C' "$@"
>> OPTION 2 <<
Make these changes in the launcher:
#!/bin/sh -> #!/bin/bash
CHROMIUM_FLAGS -> "${CHROMIUM_FLAGS[@]}"
Then ~/.chromium-browser.init would allow for arrays whose elements can
contain spaces:
CHROMIUM_FLAGS=(--enable-logging=stderr --user-agent="A B C")
--
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to chromium-browser in Ubuntu.
https://bugs.launchpad.net/bugs/1514484
Title:
Chromium start-up script doesn't accept argument values with spaces in
$CHROMIUM_FLAGS, cause is lack of quotes
Status in chromium-browser package in Ubuntu:
Triaged
Bug description:
You can't have arguments with spaces inside CHROMIUM_FLAGS, whatever
comes after the first space is going to be interpreted as an URL by
the actual chromium binary. Easy repro:
1. Set user's CHROMIUM_FLAGS with an argument containing spaces, eg:
$ echo 'CHROMIUM_FLAGS=--user-agent="A B C"' > .chromium-browser.init
2. Run chromium:
$ /usr/bin/chromium-browser
3. See 2 extra open tabs, one trying to open URL 'B', the other 'C'.
The cause for this funny behavior is the lack of quotes around
$CHROMIUM_FLAGS in the script installed in /usr/bin/chromium-browser
-- it calls $LIBDIR/$APPNAME $CHROMIUM_FLAGS "$@" by the end of the
script. I've tried working around it but couldn't, no amount of
escaping and extra quotes seems to help if it's called like that.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1514484/+subscriptions
--
Mailing list: https://launchpad.net/~desktop-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help : https://help.launchpad.net/ListHelp