Skip to content
Merged
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: 6 additions & 5 deletions dissect/target/tools/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,10 @@

def do_man(self, line: str) -> bool:
"""alias for help"""
return self.do_help(line)
self.do_help(line)
return False

Check warning on line 310 in dissect/target/tools/shell.py

View check run for this annotation

Codecov / codecov/patch

dissect/target/tools/shell.py#L309-L310

Added lines #L309 - L310 were not covered by tests

def complete_man(self, *args) -> list[str]:
def complete_man(self, *args: list[str]) -> list[str]:
return cmd.Cmd.complete_help(self, *args)

def do_unalias(self, line: str) -> bool:
Expand Down Expand Up @@ -403,16 +404,16 @@
self.histfile = pathlib.Path(getattr(target._config, "HISTFILE", self.DEFAULT_HISTFILE)).expanduser()

# prompt format
self.prompt_ps1 = "{BOLD_GREEN}{base}{RESET}:{BOLD_BLUE}{cwd}{RESET}$ "
if ps1 := getattr(target._config, "PS1", None):
if "{cwd}" in ps1 and "{base}" in ps1:
self.prompt_ps1 = ps1
else:
self.target.log.warning("{cwd} and {base} were not set inside PS1, using the default prompt")

Check warning on line 412 in dissect/target/tools/shell.py

View check run for this annotation

Codecov / codecov/patch

dissect/target/tools/shell.py#L412

Added line #L412 was not covered by tests

elif getattr(target._config, "NO_COLOR", None) or os.getenv("NO_COLOR"):
self.prompt_ps1 = "{base}:{cwd}$ "

else:
self.prompt_ps1 = "{BOLD_GREEN}{base}{RESET}:{BOLD_BLUE}{cwd}{RESET}$ "

super().__init__(self.target.props.get("cyber"))

def _get_targetrc_path(self) -> pathlib.Path:
Expand Down
Loading