Check for KeyboardInterrupt
This commit is contained in:
parent
61250fed0d
commit
f2a45a7ca3
6
fedit.py
6
fedit.py
@ -19,6 +19,7 @@ BOOT_DIR = "/boot"
|
|||||||
ETC_DIR = "/etc"
|
ETC_DIR = "/etc"
|
||||||
|
|
||||||
# ----- Exit Codes -----
|
# ----- Exit Codes -----
|
||||||
|
E_INTERRUPT = 1
|
||||||
E_NOEDITORFOUND = 2
|
E_NOEDITORFOUND = 2
|
||||||
E_NOFILESELECTED = 3
|
E_NOFILESELECTED = 3
|
||||||
|
|
||||||
@ -200,7 +201,10 @@ if __name__ == "__main__":
|
|||||||
else locate_files(args.patterns)
|
else locate_files(args.patterns)
|
||||||
)
|
)
|
||||||
|
|
||||||
selected_file = run_fzf(files)
|
try:
|
||||||
|
selected_file = run_fzf(files)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
exit(E_INTERRUPT)
|
||||||
|
|
||||||
if selected_file != "":
|
if selected_file != "":
|
||||||
cmd = gen_editor_cmd(selected_file)
|
cmd = gen_editor_cmd(selected_file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user