-
Notifications
You must be signed in to change notification settings - Fork 106
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 a focus
and a tag
command for remote interaction through the FIFO
#35
base: master
Are you sure you want to change the base?
Conversation
This commit adds a `focus` command to the list of supported commands available through the external FIFO, which switches focus to the window whose id is equal to the one passed as parameter.
Introduce a `tag` command that allows assigning a tag to a visible window through the commands FIFO. This commit also fixes the `bitoftag` function which compared pointers instead of the actual characters of the strings containing the tags.
Thanks! Improving the scripting ability of dvtm is something I would like to do. Eventually my vis editor should also use a client/server design similar in spirit to Kakoune. Are your integration scripts online somewhere? Just a few remarks from a quick glance at the diff:
|
You can find my WIP
Since right now there are only one byte long tags (as far as I know?), I went for the least expensive check and decided not to use
No reason, I just did a lazy copy/paste of the loop in the
A dedicated tool to interact with a session would be nice indeed ( |
In the default configuration yes. However I know that some people use longer tag names. We should keep that working.
Maybe a short single line comment in |
Since tags can be set to strings longer than the default one byte long digits, we need to compare the whole strings and not only the first character. Assigning a tag should not depend on the visibility of a window, so we loop over all the clients (as opposed to only the visible ones).
Commits added that take into account the remarks above. I have also made a PoC version of a |
Your changes and the
Also a man page for |
This commit updates the documentation of the `create`, `focus` and `tag` commands in the default configuration file; the `tagid` function no longer expects tags to be integers and only appends tags instead of replacing them; the `focusid` function allows focusing non-visible windows.
THe `untagid` function the implements the `untag` command removes the given tags from the ones assigned to a window.
Introduce the `dvtm-cmd` wrapper that allows interacting with `dvtm` through its command FIFO easily. A man page that documents its features was also added, and they are both installed by default.
The remarks above have been taken into account. I haven't implemented the Implementing bi-directional communications would be a major overhaul (we would have to get the return messages back from the command functions to the
|
Hi, I committed the first part of your changes. Thanks! With your original code it was possible to "lose" windows by removing all tags. I think this is rather confusing, we now check that each window is assigned to at least one tag. Furthermore unknown tags are now properly ignored. I also removed the
I agree supporting bidirectional communication would require a major overhaul, but it might be useful to support "query commands". At the moment there exists no feedback whatsoever whether the command succeeded etc. Also depending on As for the manual page, it seems like you used Docbook as source format? I would prefer a handwritten man page in Thanks again! |
Thanks for integrating the changes, they will be helpful. I use I'll go over the commits made and rebase this branch on |
Hi,
I've added support for
dvtm
to my editor, and I needed two more commands to match my workflow withtmux
before I switched over todvtm
. Those two commands arefocus
andtag
, both implemented duplicating/tweaking already existing code.There's an additional commit that improves the readability of a function by using an
if
statement instead of aswitch
, but it's just cosmetics so feel free to drop it if you don't like it.HTH.