Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl+C command does not interrupt conn.run(...) command, no KeyboardInterrupt is thrown #2268

Open
roman-ku opened this issue May 8, 2023 · 0 comments

Comments

@roman-ku
Copy link

roman-ku commented May 8, 2023

Describe the bug
Ctrl+C does not interrupt running conn.run command
conn.run(...)

To Reproduce

print('\n>>>>> Connecting to remote host')
conn = Connection(host=IP_ADDRESS, user=USERNAME, connect_kwargs={'password': PASSWORD})

with conn.cd(env['remote_dir']):

    print('\n>>>>> Deploying Service')                
    cmd = "bash service_start.bash"
    print(cmd)
    rslt = conn.run(cmd)

    try:
        print('\n>>>>> Showing Log for Program')
        conn.run('tail service_log.log -F -n 50'.format(env['app_name']), pty=False)
    except KeyboardInterrupt:
        pass
    
print('\n>>>>> Closing Connection to Host')   
conn.close()

Expected behaviour
except program to issue KeyboardInterrupt and exit conn.run(...) command

Environment
Make sure your report gets the attention it deserves: bug reports with missing
information may be ignored or punted back to you, delaying a fix. The below
constitutes a bare minimum; more info is almost always better:

  • What version of the Python interpreter are you using? Are you using an
    alternative interpreter such as PyPy?
    Python 3.10.1
  • What operating system are you using both client & server-side?
  • OS Client: win10, service-side: dietpi
  • Are you using OpenSSH server or something else?
  • Don't think so
  • Which version or versions of the software are you using?
  • fabric-3.0.1
    • Have you already tried the latest release?
    • Have you, or can you, try some older releases to pin down where the bug
      appeared?
      I think this worked correctly (as expected in fabric 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant