]> git.armaanb.net Git - lightcards.git/commitdiff
Replace $EDITOR in menu with actual editor
authorArmaan Bhojwani <me@armaanb.net>
Sat, 13 Feb 2021 19:33:35 +0000 (14:33 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Sat, 13 Feb 2021 19:33:35 +0000 (14:33 -0500)
lightcards/display.py

index 049a0167ef847afa526f06f25994a852716212ac..e91fed1a302db23d1626464d44c869df0c0194b9 100644 (file)
@@ -132,6 +132,7 @@ class Menu:
             curses.color_pair(1) + curses.A_BOLD,
         )
         self.win.hline(2, 1, curses.ACS_HLINE, mcols)
+        env = os.environ.get("EDITOR", "$EDITOR")[:15]
         text = [
             "[y]: reset stack to original state",
             "[a]: alphabetize stack",
@@ -140,8 +141,7 @@ class Menu:
             "[u]: unstar all",
             "[d]: star all",
             "[s]: update stack to include starred only",
-            "[e]: open the input file in $EDITOR",
-            "",
+            f"[e]: open the input file in {env}" "",
             "[r]: restart",
             "[m]: close menu",
         ]