Add explicit environment propagation
This commit is contained in:
@@ -42,6 +42,7 @@ pub fn spawn_pty_session(
|
||||
shell: &str,
|
||||
cols: u16,
|
||||
rows: u16,
|
||||
env: &[(String, String)],
|
||||
tx: mpsc::UnboundedSender<PtyOutput>,
|
||||
) -> Result<PtyHandle> {
|
||||
let pty_system = NativePtySystem::default();
|
||||
@@ -56,6 +57,9 @@ pub fn spawn_pty_session(
|
||||
let mut cmd = CommandBuilder::new(shell);
|
||||
cmd.env("TERM", "xterm-256color");
|
||||
cmd.env("COLORTERM", "truecolor");
|
||||
for (name, value) in env {
|
||||
cmd.env(name, value);
|
||||
}
|
||||
cmd.env("SHELL", shell);
|
||||
if let Some(home) = dirs::home_dir() {
|
||||
cmd.env("HOME", home.as_os_str());
|
||||
|
||||
Reference in New Issue
Block a user