You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The remote client completely ignores the --detach-keys option for exec
sessions. The ExecStartAndAttach() function in pkg/bindings/containers/attach.go
hardcodes empty detach keys ([]byte{}) instead of using the detach keys
stored in the exec session configuration.
This prevents users from detaching from exec sessions using custom key
sequences, making the --detach-keys option ineffective.
This commit fixes the issue by:
1. Extracting detach keys from the exec session after inspection
2. Parsing them using term.ToBytes() (unless empty string)
3. Using the parsed keys in both detach.Copy() calls
The fix maintains backward compatibility:
- Exec sessions without detach keys -> empty string -> []byte{} (unchanged)
- Empty detach keys (--detach-keys="") -> empty string -> []byte{} (correct)
- Custom detach keys -> parsed and used (new functionality)
Related to PR #25083 and issue #25089 which track comprehensive detach
key functionality. A proper interactive test for detach behavior exists
in test/system/450-interactive.bats but is currently skipped for remote
exec pending additional infrastructure work.
Signed-off-by: shiavm006 <shivammittal42006@gmail.com>
0 commit comments