Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Use $EDITOR to open files in modify-cmdline #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions user-scripts/modify-cmdline
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,7 @@ def process_args():


def cli_editors():
if path_exists("/usr/bin/nano"):
os.system(f"nano {temp_cmdline_file}")
elif path_exists("/usr/bin/vim"):
os.system(f"vim {temp_cmdline_file}")
elif path_exists("/usr/bin/vi"):
os.system(f"vi {temp_cmdline_file}")
else:
print_error("No text editor found. Please install nano/vim/vi")
exit(1)

os.system(f"{os.environ["EDITOR"]} {temp_cmdline_file}")

if __name__ == "__main__":
args = process_args()
Expand Down