Skip to content

Commit 7b1b8b1

Browse files
committed
Restored called to expanduser in do_edit() instead of relying on do_shell() to do it.
This should prevent issues if someone has an overridden do_shell() that doesn't expand ~ in paths.
1 parent f69b255 commit 7b1b8b1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.9.10 (February 22, 2019)
2+
* Bug Fixes
3+
* Fixed unit test that hangs on Windows
4+
15
## 0.9.9 (February 21, 2019)
26
* Bug Fixes
37
* Fixed bug where the ``set`` command was not tab completing from the current ``settable`` dictionary.

cmd2/cmd2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3356,9 +3356,9 @@ def do_edit(self, args: argparse.Namespace) -> None:
33563356
if not self.editor:
33573357
raise EnvironmentError("Please use 'set editor' to specify your text editing program of choice.")
33583358

3359-
command = utils.quote_string_if_needed(self.editor)
3359+
command = utils.quote_string_if_needed(os.path.expanduser(self.editor))
33603360
if args.file_path:
3361-
command += " " + utils.quote_string_if_needed(args.file_path)
3361+
command += " " + utils.quote_string_if_needed(os.path.expanduser(args.file_path))
33623362

33633363
self.do_shell(command)
33643364

0 commit comments

Comments
 (0)