From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17176 invoked from network); 30 Dec 2020 22:52:23 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Dec 2020 22:52:23 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1609368743; b=1c4paF/Wmzb/xSBZ2gGrk29+C8V89gEqUj8j0DTgeYzzvfC3d2lZ/yLw/3h5UKz7X71SGndViO 3Yowf5uybzlGJXYalpfC8dI4esDZetR+l568785vAhANTqPoOpwzGKN2NmWRSTckm7416XenOS gcNA6qklNz3U2YkkTfp4vUMnpx1J8AyoKM7uRAqIoGsHjFUKI78qOd9r2rJoVU1pknQRQUG94Y IYo0zn48H1E2RYWHoFVvdsVd+HTdhGd4mmaq6/iWN2fQGuaL+4a3i7+n/DpbX7ggs4J7R7hlRb Low89qY26JsDyhIhnlRnGeemrn2OmR6ftx66Xam4KEbi8Q==; ARC-Authentication-Results: i=1; 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1609368743; bh=drrAad97WYuit7pf2WYbU1Z/bqhi7nzuMZoIFcYVNeA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:From:Date:DKIM-Signature:DKIM-Signature; b=zakZpUptRjODFcln9f+ltFFcuesAwBiatOQsOTtdiBhewHHIuESMSoj5xnxjTIBAgCyKge3cXF 6wMXmXTLf3MEfL2pJKMsoQKya90qquIEdUmvXYV2DYAAn1cAgJ7HosDZFu+yLzuCgC4rtO5fR3 MGkUQzWkRYlnevA6QyoPdFx41BSYBmy+hDhA8wDtNQMBccIzKzpSmMoeeynmicjidrcRS/lg1p g35GdWDeLuyvJig/5rQKFt+ajFJhKdoWg7XUF1Vx1fx5TnHHUF2bNEISGN+8c81OMWdaqPMmcO 0fN6YU/9rtk2otnzVoxNMvQ2ug0w/l6SWdzzZ5djhSymOQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:Mime-Version :References:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=XCcsh1x/+CnTjixaThMXwv7KQjebYFHvmd42GASMF0c=; b=FfZHTw+nKQ8+F6yJixYAE3e93M THz87pTbQualMluJhnGMs6p/dU2Mcg1FQUFW8/NB7/z50GUFvVJP+LT5OGQ47MdjLwRVmvFw0uhn9 /b1xTDGJR90FzsLIDkscP3xhjGwk+Twj+xSamsnUWoxGkBAV5IdnkznzjiTCn5Dz4lwHI2rmCYjQR 3q4educnpyvAGOL31Vb0jfN+t7i2fBril1ZNLvT0lUUC4ZlpG7zJzRkc2z1JHV/oTJOQcfhWB892x tkwGgewh/s2U72FtcUWyRXTG9Bre6dUspB5/0SEGfCqK7BbouURUuuJwoTo14a/r0B9TCONkw5w7+ YVEk7cqw==; Received: from authenticated user by zero.zsh.org with local id 1kukKL-0007MA-JK; Wed, 30 Dec 2020 22:52:21 +0000 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 Received: from smtp.splintermail.com ([209.180.253.200]:40620 helo=splintermail.com) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kukK5-0007EM-8h; Wed, 30 Dec 2020 22:52:06 +0000 Received: (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by splintermail.com (Postfix) with ESMTPSA id B8690A015B for ; Wed, 30 Dec 2020 15:52:03 -0700 (MST) 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= Date: Wed, 30 Dec 2020 15:52:03 -0700 From: Ryan Beethe To: zsh-workers@zsh.org Subject: Silently capture completion options Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Seq: 47781 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: 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?