Xpra-org / xpra

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.

Home Page:https://xpra.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

run_scaled parsed is wrong making it impossible to use it as intended.

fcolecumberri opened this issue · comments

In

xpra/fs/bin/run_scaled

Lines 89 to 90 in 90f6ae4

if extra_xpra_args is None:
command_argv.append(x)

The if is always false. You are checking that extra_xpra_args is not None which is impossible since that variable is initialized as [] which python considers it different than None and it never is assigned to None.

The problem with this is that the very next line is the only place where command_argv can be filled (unless you split the command with --) rendering impossible to fill.

Because of this, always at

xpra/fs/bin/run_scaled

Lines 93 to 94 in 90f6ae4

if not command_argv:
usage("missing command argument")

the message of missing command is printed and the program exits as failure.

This is clearly an error, and I would gladly make a pull request but I have no idea about the intention behind that if so I thought it would be better to report this as an issue.

Also some people might argue that since the cli can be ussed splitting the argument with -- is not a problem, but the usage message mentions nothing about it.

xpra/fs/bin/run_scaled

Lines 11 to 16 in 90f6ae4

def usage(msg, exit_code=1):
if msg:
sys.stderr.write("%s\n" % msg)
sys.stderr.write("usage: run_scaled --scale=VALUE application [optionalarguments]\n")
sys.stderr.write(" ie: run_scaled --scale=2 xterm +ls -fg blue\n")
sys.exit(exit_code)

@fcolecumberri thanks, how about this updated version:
https://github.com/Xpra-org/xpra/blob/530a19421401a279270fb7fbbff1ee46da82211e/fs/bin/run_scaled

See 530a194 for the list of changes.
I forgot one: it should now start much more quickly thanks to --start-new-commands=no, --audio=no and --video=no.

This does make me think about other options which may need to be added to the defaults:

  • dbus and notifications: should we just leave the environment as it is and let them pass through - I don't see why not
  • what about --open-url and --open-files..
    Probably more options could be tweaked.

thanks