`--force-command` does not inherit `UPTERM_ADMIN_SOCKET` environment variable
When passing --force-command to upterm host (e.g. to invoke tmux), the environment variable UPTERM_ADMIN_SOCKET is not passed to the command. As a result, even with
set -ag update-environment UPTERM_ADMIN_SOCKET
in ~/.tmux.conf, as suggested by the README, upterm session current does not work inside tmux.
host/internal/server.go:startAttachCmd should probably be modified to take care of this.
High, I just ran into the same problem. I was trying one of the examples from the README:
upterm host --force-command 'tmux attach -t pair-programming' -- tmux new -t pair-programming
This doesn't work:
- Upterm launches
tmuximmediately, hiding the message with the session information. - You can't run
upterm session currentinside the tmux session because the environment variable isn't set - So: There's no way to provide your pair programming partner with the necessary connection information.
I just verified that upterm session current works for me with tmux version 3.5a. I have the following in my ~/.tmux.conf:
set-option -ga update-environment " UPTERM_ADMIN_SOCKET"
Ref: https://github.com/owenthereal/upterm?tab=readme-ov-file#resolving-tmux-session-display-issue.
If upterm session current doesn't work for some reasons, you could always list all sessions with upterm session list and then upterm session info NAME to get the connection info.
I think I need to be a bit clearer; this has nothing to do with tmux. tmux was just an example.
Steps to reproduce:
upterm host --force-command /bin/bash ...
[connect to the session via ssh]
$ echo $UPTERM_ADMIN_SOCKET
$