mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 21:21:15 -03:00
pexpect: Remove some unnecessary empty lines
This strips the newline from "code_context" (which is really just the called function), and from the unescaped output. Rather, in case the output doesn't end with a newline it'll mark it with an explicit message "(no trailing newline)".
This commit is contained in:
@@ -262,7 +262,7 @@ class SpawnedProc(object):
|
|||||||
filename, lineno, code_context = get_callsite()
|
filename, lineno, code_context = get_callsite()
|
||||||
fmtkeys["filename"] = filename
|
fmtkeys["filename"] = filename
|
||||||
fmtkeys["lineno"] = lineno
|
fmtkeys["lineno"] = lineno
|
||||||
fmtkeys["code"] = "\n".join(code_context)
|
fmtkeys["code"] = "\n".join([n.strip() for n in code_context if n])
|
||||||
|
|
||||||
if unmatched:
|
if unmatched:
|
||||||
print(
|
print(
|
||||||
@@ -285,7 +285,10 @@ class SpawnedProc(object):
|
|||||||
print("{CYAN}<-------{RESET}".format(**colors))
|
print("{CYAN}<-------{RESET}".format(**colors))
|
||||||
sys.stdout.write(self.spawn.before)
|
sys.stdout.write(self.spawn.before)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
print("{RESET}\n{CYAN}------->{RESET}".format(**colors))
|
maybe_nl=""
|
||||||
|
if not self.spawn.before.endswith("\n"):
|
||||||
|
maybe_nl="\n{CYAN}(no trailing newline)".format(**colors)
|
||||||
|
print("{RESET}{maybe_nl}{CYAN}------->{RESET}".format(maybe_nl=maybe_nl, **colors))
|
||||||
|
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user