From 09640b7a8c65a660bdc5c996cba428f6df71e574 Mon Sep 17 00:00:00 2001
From: Michael Aaron Murphy <mmstickman@gmail.com>
Date: Wed, 29 Nov 2017 14:27:48 -0500
Subject: [PATCH] Revert Fork Changes

---
 src/shell/fork.rs           | 5 ++---
 src/shell/pipe_exec/fork.rs | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/shell/fork.rs b/src/shell/fork.rs
index 852d770c..069dac92 100644
--- a/src/shell/fork.rs
+++ b/src/shell/fork.rs
@@ -85,10 +85,9 @@ impl<'a> Fork<'a> {
                     drop(read);
                 }
 
-                // Execute the given closure within the child's shell, and stop the context's
-                // background thread. NOTE: That last thing solves a memory leak.
+                // Execute the given closure within the child's shell.
                 let mut shell: Shell = unsafe { (self.shell as *const Shell).read() };
-                shell.context.take().map(|mut c| c.history.commit_history());
+                //  shell.context.take().map(|mut c| c.history.commit_history());
                 child_func(&mut shell);
 
                 // Reap the child, enabling the parent to get EOF from the read end of the pipe.
diff --git a/src/shell/pipe_exec/fork.rs b/src/shell/pipe_exec/fork.rs
index 0b0fde6c..47db5635 100644
--- a/src/shell/pipe_exec/fork.rs
+++ b/src/shell/pipe_exec/fork.rs
@@ -30,7 +30,7 @@ pub(crate) fn fork_pipe(
 
             // Drop the context and it's background thread in the child.
             // NOTE: Solves a memory leak.
-            shell.context.take().map(|mut c| c.history.commit_history());
+            // shell.context.take().map(|mut c| c.history.commit_history());
 
             // After execution of it's commands, exit with the last command's status.
             exit(pipe(shell, commands, false));
-- 
GitLab