-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
fix(nixos-generate-config): dont output carriage returns in output files #439
Conversation
What version did you use for nixos-facter? We switched logging libraries at some point, which resolved an issue with ANSI escapes. |
should have quoted: nixos-anywhere/src/nixos-anywhere.sh Lines 457 to 459 in bf4c0c5
I was unsure what 'weird characters' referred to. So maybe what you refer to fixed that, but CRLF in output persists with tty allocation with ssh. I tested with: ssh -t localhost nixos-generate-config --show-hardware-config --no-filesystems > ngc-old.out
ssh -t localhost "stty nl; nixos-generate-config --show-hardware-config --no-filesystems" > ngc-new.out
ssh -t localhost sudo nixos-facter > facter-old.out
ssh -t localhost "stty nl; sudo nixos-facter" > facter-new.out
fd -e out -x nix shell nixpkgs#tinyxxd -c xxd {} {.}.xxd file *.out
facter-new.out: JSON text data
facter-old.out: JSON text data
ngc-new.out: Unicode text, UTF-8 text
ngc-old.out: Unicode text, UTF-8 text, with CRLF line terminators delta --side-by-side ngc-old.xxd ngc-new.xxd
delta --side-by-side facter-old.xxd facter-new.xxd this is diffs show CRLF in the |
We can remove the comment. It was caused by charm bracelet's logging library: numtide/nixos-facter#119 |
Are you running on macOS on the host by chance? |
But I think you are write, we shouldn't use |
Could you try to remove it and see if this is fixing the issue? |
my client is NixOS-wsl. dont know what reporter in #438 is running. created a new runSshNoTty function that omits the tty request. tested outputs of both |
@Enzime this is also what we saw the other day. But with macOS line endings. |
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 24f2d37 |
ssh -t
is being used byrunSsh
which causes new lines in output designed for a terminal. It could also output escape sequences.https://unix.stackexchange.com/a/420438
this change fixes this problem (#438) by only outputting new lines. but it might be worth removing ssh password entry as an option and the tty allocation, and force the use of sshpass for passwords.
There is a FIXME note regarding the output of the
nixos-facter
with strange characters. This may resolve that as well.Also updated the message about
nixos-facter
not being found to hopefully clarify and resolve #423 around the--generate-hardware-config
option.