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

Always block when run with "wezterm -e" #4535

Merged
merged 2 commits into from
Feb 3, 2024
Merged

Always block when run with "wezterm -e" #4535

merged 2 commits into from
Feb 3, 2024

Conversation

vimpostor
Copy link
Contributor

See #4523

There is no way to do this with a declarative clap macro, so we have to fake it instead.

Copy link
Owner

@wez wez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An inventive approach!

I'm curious about how this impacts the --help output. Since the -e alias has now been moved to a hidden command, they need updating anyway, so please also update the doc pages for the cli; the steps are:

$ cargo build
$ ci/update-derived-files.sh
$ ci/build-docs.sh

What that does is run wezterm CMD --help for each subcommand and embed it into the docs. Then the doc build runs to reformat the docs and minimize the diff.

then amend the updated files into this PR.

I think that it would be good to explicitly mention the -e flag somewhere reasonable and discoverable in the clap help. To cover the bases, I think that means wezterm --help, wezterm-gui --help and wezterm start --help.

wezterm-gui/src/main.rs Outdated Show resolved Hide resolved
This is done for compatibility, as many tools assume that running a
command with "$TERMINAL -e $COMMAND" blocks until the command is
finished.

For example some tools delete a needed file after the command returns.
But since we always return immediately (in case --always-new-process is
not provided and if another wezterm instance is already running), this
would mean that the file is deleted before the command could do
anything.

Fixes wez#4523
Otherwise it is just hidden forever. We can't use the proper declarative
interface, because we are faking quite some stuff for "-e", so instead
we mention it explicitly in the help output.
@vimpostor
Copy link
Contributor Author

I think that it would be good to explicitly mention the -e flag somewhere reasonable and discoverable in the clap help. To cover the bases, I think that means wezterm --help, wezterm-gui --help and wezterm start --help.

Done, I mention -e explicitly in the help output now. Let me know if you prefer another format.

@wez wez merged commit beb29e8 into wez:main Feb 3, 2024
15 checks passed
wez added a commit that referenced this pull request Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants