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

Add /in command and supporting changes #118

Merged
merged 4 commits into from
Apr 17, 2024
Merged

Add /in command and supporting changes #118

merged 4 commits into from
Apr 17, 2024

Conversation

TheDaemoness
Copy link
Collaborator

/in allows running focus-sensitive commands in a different focus than the current one.
Also lays some of the groundwork for potential future meta-commands
and adjusts how subfocuses are indicated in the status line and window title.

Caveats:

  • /masks still doesn't work on channels that haven't been loaded yet.
    This will require a minor change to how channel state is handled, namely creating ChannelState for channels one isn't in but marking those states as "stale".
  • There's no tab completion for the command given to /in.
    Tab completion needs big changes for this to work (maybe making it the responsibility of the argument spec rather than the command itself?).

This allows running commands like setwindow or mode
in contexts other than the currently focused window.

Also adds two new command types, adds focus to the context Args can work with,
and reworks a handful of commands to not fetch clientFocus themselves.
It also tweaks /list to not use extensionArg anymore.

There is still some work that needs doing in support of this one command
(as well as future metacommands but never mind):
- Tab completion needs to be burned to the ground.
- Views (names, masks) need to be changed to respect the override.
- `/in #channel-im-not-in masks b` should really just work.

ClientCommands don't make sense with /in and can exhibit surprising behavior,
and so /in currently rejects them.
Also adjusts the status line to show overridden foci.
Minor changes were made in an earlier commit.
These changes are a bit more radical due to subfocuses
no longer being "sub"focuses so much.

Also changes the application title.
This commit also undoes a decision to forbid client-wide commands from /in.
It's simpler this way.
@glguy glguy merged commit 08a7f94 into v2 Apr 17, 2024
6 checks passed
@glguy glguy deleted the metacmd-basics branch April 17, 2024 21:25
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