mirror of
				https://github.com/sammy-ette/Hilbish
				synced 2025-08-10 02:52:03 +00:00 
			
		
		
		
	fix: reuse runner instance
makes sure that env vars set in shell persist, among other things.
This commit is contained in:
		
							parent
							
								
									1febe66f84
								
							
						
					
					
						commit
						6db529e6ac
					
				
							
								
								
									
										2
									
								
								exec.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								exec.go
									
									
									
									
									
								
							| @ -260,8 +260,6 @@ func execCommand(cmd string, terminalOut bool) (io.Writer, io.Writer, error) { | ||||
| 		return nil, nil, err | ||||
| 	} | ||||
| 
 | ||||
| 	runner, _ := interp.New() | ||||
| 
 | ||||
| 	var stdout io.Writer | ||||
| 	var stderr io.Writer | ||||
| 	if terminalOut { | ||||
|  | ||||
							
								
								
									
										3
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								main.go
									
									
									
									
									
								
							| @ -17,6 +17,7 @@ import ( | ||||
| 	"github.com/pborman/getopt" | ||||
| 	"github.com/maxlandon/readline" | ||||
| 	"golang.org/x/term" | ||||
| 	"mvdan.cc/sh/v3/interp" | ||||
| ) | ||||
| 
 | ||||
| var ( | ||||
| @ -33,9 +34,11 @@ var ( | ||||
| 	hooks *bait.Bait | ||||
| 	defaultConfPath string | ||||
| 	defaultHistPath string | ||||
| 	runner *interp.Runner | ||||
| ) | ||||
| 
 | ||||
| func main() { | ||||
| 	runner, _ = interp.New() | ||||
| 	curuser, _ = user.Current() | ||||
| 	homedir := curuser.HomeDir | ||||
| 	confDir, _ = os.UserConfigDir() | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user