-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
nix repl renders strings improperly escaped #4909
Comments
This isn't rendering a string, but presenting a Nix language parsing error in a confusing way. Does this look less confusing?
An even nicer error would catch this specific mistake and show a custom error message explaining what you probably did wrong. Something like: it seems like you're using bash interpolation syntax inside a Nix interpolated string. Did you forget to escape the $ sign? |
I don't really care about the error message, to be honest. The main issue is that the repl is actually rendering nix values in a way that they are not valid nix, i. e. a properly escaped nix string will evaluate to a nix string which is then rendered by the repl as invalid nix syntax:
The error message was just added to demonstrate that pasting back the printed nix expression in the repl will result in an error. |
I marked this as stale due to inactivity. → More info |
Hasn't been fixed. |
I marked this as stale due to inactivity. → More info |
Still an issue in Nix 2.9. |
Basically,
|
Cool, I just ran into this today. I like to use REPLs though a lot, and might try to see about writing a PR to fix this. Might take a second though -- I'm a little out-of-practice with C++. |
Hi @cyntheticfox, I've encountered the cause of the issue while resolving some tech debt. |
Describe the bug
nix repl
prints string values improperly sometimes where pasting the printed expression back into the repl would result in a syntax error due to missing escaping.Steps To Reproduce
Evaluate
''''${checkFlagsArray[@]}''
or"\${checkFlagsArray[@]}"
intonix repl
and paste the printed result back:Expected behavior
nix repl
prints"\${checkFlagsArray[@]}"
Additional context
Affects
nixUnstable
andnix
2.13.11.The text was updated successfully, but these errors were encountered: