ZIm/crates/zed/src
Thorsten Ball 7dbcace839
Fix accidentally dropping shell environment variable (#10105)
Previously this code would run the changed commend, take its output,
remove the `marker` from the front and then split on `0` byte.

Problem was that `echo` adds a newline, which we did *NOT* skip. So
whatever `env` printed as the first environment variable would have a
`\n` in front of it.

Instead of setting, say, `HOME`, Zed would set `\nHOME`.

This change fixes the issue by switching to `printf '%s' marker`, which
is more portable than using `echo -n`.

This is related to https://github.com/zed-industries/zed/issues/9786 but
I'm not sure yet whether that fixes it.

Release Notes:

- Fixed Zed sometimes missing environment variables from shell in case
they were the first environment variable listed by `/usr/bin/env`.
2024-04-03 09:34:17 +02:00
..
zed Split DuplicateLine into DuplicateLineUp and DuplicateLineDown (#9715) 2024-03-28 12:52:08 +02:00
main.rs Fix accidentally dropping shell environment variable (#10105) 2024-04-03 09:34:17 +02:00
zed.rs gpui: Add support for window transparency & blur on macOS (#9610) 2024-03-29 11:10:47 -04:00