Hi Mario! Unfortunately Fabric 1.x was always pretty poor at true interactive interfaces in exactly the way you've encountered, and there's no great workaround for it.
Fabric 2 is significantly better in this regard (it's built on Invoke, which has a way more robust I/O handling setup) but would require you to port over your Fabric 1-using code (see eg: https://www.fabfile.org/upgrading.html). If I were you, I'd take advantage of the fact that you can have /both/ versions of Fabric installed at the same time, and just try using Fabric 2 in the one spot you're doing interactive remote things, to try it out. E.g.: from fabric2 import Connection Connection('targethostname').run('vim', pty=True) works pretty well for me. Occasionally a few weird hiccups that I think are due to my desktop setup, but again, /much/ closer to the real thing than Fabric 1. Best, Jeff On Tue, Apr 9, 2024 at 9:48 PM Mario Gómez <[email protected]> wrote: > *Hi guys!* > > I think Fabric's great, but today I came into a situation that involved an > interactive dialog. You know, those that requiere you to press the down or > up key in order to select some option. Then you'd press the space bar, then > TAB to switch to 'OK', then ENTER. > > I was unable to succeed because the instant I pressed the down arrow > Fabric took it for ENTER, thus continuing to the next host. > > Is there any way I can make arrow keys work interactively? Maybe importing > some library in my fabfile.py? > > I already installed readline and gnureadline, but they didn't help either. > > Thanks in advance. > > *Mario.* > > *PS:* I'm using Fabric 1.15.0. > > Sent from Outlook <http://aka.ms/weboutlook> > -- Jeff Forcier Linux sysadmin; Python engineer https://bitprophet.org
