Pass session environment variables to command
This commit is contained in:
parent
d829810b8b
commit
6c5d6ee83e
|
@ -1,2 +1,5 @@
|
|||
0.1.1:
|
||||
- Pass session environment variables to command
|
||||
|
||||
0.1.0:
|
||||
- Initial release
|
||||
|
|
|
@ -26,8 +26,9 @@ portals:
|
|||
command: ps -aux
|
||||
host:
|
||||
- localhost:19003
|
||||
- :19004 # Expose port 19004 to the internet
|
||||
system monitor:
|
||||
command: htop
|
||||
host:
|
||||
- localhost:19004
|
||||
- localhost:19005
|
||||
```
|
||||
|
|
|
@ -61,6 +61,7 @@ func NewPortal(name string, address string, command []string) (*Portal, error) {
|
|||
}
|
||||
|
||||
cmd := exec.CommandContext(cmdCtx, command[0], args...)
|
||||
cmd.Env = sshSession.Environ()
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("TERM=%s", ptyReq.Term))
|
||||
|
||||
f, err := pty.Start(cmd)
|
||||
|
|
Loading…
Reference in New Issue