Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around trailing null characters in zsh #465

Merged
merged 1 commit into from
Nov 27, 2023
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
6 changes: 5 additions & 1 deletion test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ def run_command(self, command, **kwargs):
raise Exception("Expected to see a newline in command response")
echo_cmd, actual_res = res.split("\n", 1)
res_without_ansi_seqs = re.sub(r"\x1b\[0m.+\x1b\[J", "", actual_res)
return res_without_ansi_seqs
# Unsure why some environments produce trailing null characters,
# but they break tests and trimming them seems to be harmless.
# https://github.com/kislyuk/argcomplete/issues/447
res_without_null_chars = res_without_ansi_seqs.rstrip("\x00")
return res_without_null_chars
else:
return res

Expand Down