From cs at cskk.id.au Wed Jan 15 03:55:16 2020 From: cs at cskk.id.au (Cameron Simpson) Date: Wed, 15 Jan 2020 14:55:16 +1100 Subject: How to simulate entering keys into mutt? In-Reply-To: <20200107164441.GA5820@esprimo> References: <20200107164441.GA5820@esprimo> Message-ID: <20200115035516.GA92778@cskk.homeip.net> On 07Jan2020 16:44, Chris Green wrote: >I want to emulate typing a dozen or so keys into mutt 'automatically' >so my typing doesn't slow things down. One can't just redirect >standard input because that makes mutt think you want to run in >scripting mode with everything on the command line. > >Is there a quick and easy way to do what I want? Would mutt's "push" command do you? It pushes keystrokes onto mutt's logical keyboard input queue. For example, my muttrc has this: folder-hook . 'push ":set collapse_unread=no"' folder-hook . 'push ":set auto_tag=no~T~P~NN~T:set auto_tag=yes"' folder-hook . 'push ""' to run a set of keyboard based stuff when I enter a folder. You can bind things like this to a keyboard macro, and my "mboxify" sheel script includes this incantation: mutt -n -F /dev/null -f "$mailbox" -e "set sort=mailbox-order; set confirmappend=no; set delete=yes; push '.$mailboxtmp'" to copy one mail folder's messages into a plain "mbox" mail folder. Cheers, Cameron Simpson