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 14303 invoked from network); 30 Dec 2020 22:26:56 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Dec 2020 22:26:56 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1609367216; b=Vr7bBZL8+D8ehA47USnIXj/kvjqVhonq+nW0x4rcpJuwCJC+bO9z2J3fHxOwD/qKi+/Pm34DCl lgg87DYMiooHCgQo47XseYhpvhCbUEFGLYQo1Q8vbVAKWoTBT6wxp/spNjQjyBwzOHuIiqGzGX bbUexsExwMzhE830RqrRclcihz8Vh5WnIP34N/M0AQxt3omIe+CjIfbiLLI6k2Gbzq6WJfo7/K hhxLGcF/44LIDEEpqzptWJYRPDV0UX3718Lx5LqTRz+5TWQKoYpDmRR8n3al7Vy7DuAXNHJ1cH SuwXHFP/MdV6k9Eevm7QagMx/mpMQQA9SvXYmg/mmI4AKQ==; 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=1609367216; bh=drrAad97WYuit7pf2WYbU1Z/bqhi7nzuMZoIFcYVNeA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:MIME-Version:Message-ID:Subject:To:From:Date: DKIM-Signature:DKIM-Signature; b=uS+go4tGeRfDj2LNgZS4bxUJuGJoo3A2/igAJ7odAbVpOri6WD0mPOPMh9JjTKdO+pA979GpMi tiKRD1vabTFQMGjewWEerCl3B55O6NQxAiupEakZcaTtPJfYV1qFeI/g+xtR4JgzJz6rjhicMJ 59IFkhodQEL6gOaP5nJs7tS3PpvCV0QyNrr1II9Xz+wZqIplaKe/3HLdY6X7iXgeh2auBRkJjw jIiqLBwt9LucsfIkvr1//clfXeIrU/+FnAgqVT/c2HeW/3SLFskgRttAUJsrwAOGD/vjeJlkWF N8clUZt/Gl8DBsxsXtl4/Qi18hTy4Wuh3Pww1Fh8TajiwA==; 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:Content-Type:Mime-Version: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:In-Reply-To:References; bh=XCcsh1x/+CnTjixaThMXwv7KQjebYFHvmd42GASMF0c=; b=kxKfBZ07JysAxs4Z7d57KUj3sh QKADcWx/ACRgQoJnQUkdtbF/MGO5lDV+geflkZLFaYbuJci4eNXBzLc7QxDSDCTZ9wrv3At/EZpT6 0h2zHOhjjAI/r6p1f7qw0eKKEZueHT8ckytt/tQ6MjeAwoLksV3zrZ8533G7KOl7trEhelYXHuxDG akfloX9wTy+i1qtr0GLMGlQUhKbW1yCEdf4G9eVfhYefab6KnXTjH7P6NLqali/kgeHJP6VEb0HGn y7vrLO9cayE1WDY/QgXrMo7hTJ2QJ6ce9nFKy6sd360dF2gc19PHOoY3/rGMXWEREQ97j6olN0Yay NUfB0Umw==; Received: from authenticated user by zero.zsh.org with local id 1kujvi-0006Xp-Nu; Wed, 30 Dec 2020 22:26:54 +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]:39698 helo=splintermail.com) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kujvY-0006OY-6d; Wed, 30 Dec 2020 22:26:44 +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 55214A002A for ; Wed, 30 Dec 2020 15:26:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=splintermail.com; s=mail; t=1609367202; bh=XCcsh1x/+CnTjixaThMXwv7KQjebYFHvmd42GASMF0c=; h=Date:From:To:Subject:From; b=iTwFCWYid0x7Q88sq9wQFfumvVNk6JIuad+aqp78bg0Mwv9N42W8F0lAOa/HR+hEB VDpnIR3bmqBJ1PDdUkraIkHV/988fiq7xIq64+L5qRmI4maR2Raxp29P8FV1L7N1AL R9xpfm+IjdRp3VKNkZThuekFu5vhoNd8Ion05zXI= Date: Wed, 30 Dec 2020 15:26:41 -0700 From: Ryan Beethe To: zsh-workers@zsh.org Subject: Silently capture completion options Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Seq: 47780 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?