unify Ctrl + D to exit and Ctrl + C to stop
This commit is contained in:
parent
0f04a49ef1
commit
3de5823b84
|
|
@ -42,11 +42,16 @@ def interactive(dpt, diagnosis=False):
|
||||||
cmd = input(">>> ")
|
cmd = input(">>> ")
|
||||||
cmd = cmd.lower() # convert to lower case
|
cmd = cmd.lower() # convert to lower case
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
print()
|
||||||
|
dpt.info_print("Press Ctrl + D to exit")
|
||||||
|
continue
|
||||||
|
except EOFError:
|
||||||
print()
|
print()
|
||||||
dpt.info_print("Exiting... Thanks for using...")
|
dpt.info_print("Exiting... Thanks for using...")
|
||||||
break
|
break
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
print()
|
print()
|
||||||
|
cmd = ''
|
||||||
dpt.err_print(str(e))
|
dpt.err_print(str(e))
|
||||||
if cmd == 'root':
|
if cmd == 'root':
|
||||||
obtain_diagnosis_access(dpt)
|
obtain_diagnosis_access(dpt)
|
||||||
|
|
|
||||||
|
|
@ -617,7 +617,8 @@ def diagnosis_cmd(dpt):
|
||||||
for line in resp:
|
for line in resp:
|
||||||
print(line)
|
print(line)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
break
|
dpt.info_print("\nPress Ctrl + D to exit")
|
||||||
|
continue
|
||||||
except EOFError:
|
except EOFError:
|
||||||
break
|
break
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue