Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Silently capture completion options
- X-seq: zsh-workers 47781
- From: Ryan Beethe <ryan@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Silently capture completion options
- Date: Wed, 30 Dec 2020 15:52:03 -0700
- Archived-at: <https://zsh.org/workers/47781>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-12/X%2B0Ek88baOQNCWiT%40archenemy.localdomain>
- Authentication-results: zsh.org; iprev=pass (smtp.splintermail.com) smtp.remote-ip=209.180.253.200; dkim=pass header.d=splintermail.com header.s=mail header.a=rsa-sha256; dmarc=pass header.from=splintermail.com; arc=none
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=splintermail.com; s=mail; t=1609368723; bh=XCcsh1x/+CnTjixaThMXwv7KQjebYFHvmd42GASMF0c=; h=Date:From:To:Subject:References:In-Reply-To:From; b=Of6eZEzDqfhB+eBINvJOF/UQFO7VfuNt+5qgMiiaG0tdoN7wM5JJIt0cdJI1mA+Jy BKlv8Lj3izjN21j/GOscaenXd78aNPVsdX7wQkm9VxtAoFKlopcVdJiy2brhdGH+eS 61kx4Cujs/Dk80BC/9Tj3Adx+XcQwUHkXOO05qiA=
- In-reply-to: <X+z+ocwGnHT7rh84@archenemy.localdomain>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <X+z+ocwGnHT7rh84@archenemy.localdomain>
- Sender: zsh-workers-request@xxxxxxx
I am trying to set up voice control software (talon with a wav2letter
backend) to work well with shell completion. I would like to be able to
capture what the results of a completion *would* be if it ran, but
without the normal showing of results. The goal is to be able to feed
the completions into the voice command software so that the next spoken
word can be chosen from the available completion options. The nature of
the talon/wav2letter combination seems to require that you have a
wordlist first and the audio is used to guess which word was most likely
matched.
So then the challenge is how to expose the current completion options
from a zsh prompt. The only prior art I could find was this hack on
github:
https://github.com/Valodim/zsh-capture-completion
But that's not particularly useful to me.
I could imagine two high-level ways of doing it:
- A "push" strategy where after every keystroke the completion code is
updated, a la https://github.com/marlonrichert/zsh-autocomplete. Only
in this case the results would be written to a file named after the
WINDOWID (this is all under X11). After that, watching for file
updates and tracking the focused window and notifying talon
accordingly is easy.
- A "pull" strategy where some callable function or widget can return
the results of a completion (without altering the prompt of course).
That function/widget could be triggered by trapping a signal or by
reading a packet from a socket or something. After that, I would be
able to hook the rest of the system together I believe.
I'm pretty new to trying to hack zsh. I spent a bunch of time trying to
read docs and make things work but I still don't really have any idea of
what I want is possible (or how much coding it would take to become
possible).
Does anybody have any ideas or pointers for how to do this sort of
thing?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author