Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fcolecumberri opened this issue May 10, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@fcolecumberri
Copy link

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 fcolecumberri added the bug Something isn't working label May 10, 2024
totaam added a commit that referenced this issue May 10, 2024
* fix and simplify command line parsing when [not] splitting,
* modernize code
* handle missing imports more gracefully (ie: the 'xpra' command may use a different Python interpreter, Gtk may not be available either)
* add more usage examples
@totaam
Copy link
Collaborator

totaam commented May 10, 2024

@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.

@fcolecumberri
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants