From 2d2662bd601ab27ea5f725039cb40bc7e4d35596 Mon Sep 17 00:00:00 2001 From: "Remi GASCOU (Podalirius)" <79218792+p0dalirius@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:14:13 +0200 Subject: [PATCH] Fix missing backslash at the end of prompt fixes #45 --- smbclientng/core/InteractiveShell.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/smbclientng/core/InteractiveShell.py b/smbclientng/core/InteractiveShell.py index c691b2a..ef13be2 100644 --- a/smbclientng/core/InteractiveShell.py +++ b/smbclientng/core/InteractiveShell.py @@ -987,7 +987,13 @@ def __prompt(self): else: str_prompt = "%s[\x1b[1;94m\\\\%s\\\x1b[0m]> " % (connected_dot, self.smbSession.address) else: - str_path = "\\\\%s\\%s\\%s" % (self.smbSession.address, self.smbSession.smb_share, self.smbSession.smb_cwd.lstrip(ntpath.sep)) + if len(self.smbSession.smb_cwd) == 0: + current_path = "" + else: + current_path = self.smbSession.smb_cwd.strip(ntpath.sep) + ntpath.sep + + str_path = "\\\\%s\\%s\\%s" % (self.smbSession.address, self.smbSession.smb_share, current_path) + if self.config.no_colors: str_prompt = "%s[%s]> " % (connected_dot, str_path) else: