mirror of
https://github.com/containers/podman.git
synced 2025-12-05 04:40:47 +08:00
Use terminal detach keys sequence specified in the config file
Fixes: #4556 Signed-off-by: Marco Vedovati <mv@sba.lat>
This commit is contained in:
@@ -33,6 +33,9 @@ func init() {
|
||||
attachCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := attachCommand.Flags()
|
||||
flags.StringVar(&attachCommand.DetachKeys, "detach-keys", define.DefaultDetachKeys, "Select the key sequence for detaching a container. Format is a single character `[a-Z]` or a comma separated sequence of `ctrl-<value>`, where `<value>` is one of: `a-z`, `@`, `^`, `[`, `\\`, `]`, `^` or `_`")
|
||||
// Clear the default, the value specified in the config file should have the
|
||||
// priority
|
||||
attachCommand.DetachKeys = ""
|
||||
flags.BoolVar(&attachCommand.NoStdin, "no-stdin", false, "Do not attach STDIN. The default is false")
|
||||
flags.BoolVar(&attachCommand.SigProxy, "sig-proxy", true, "Proxy received signals to the process")
|
||||
flags.BoolVarP(&attachCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
|
||||
|
||||
@@ -208,10 +208,14 @@ func getCreateFlags(c *cliconfig.PodmanCommand) {
|
||||
"detach", "d", false,
|
||||
"Run container in background and print container ID",
|
||||
)
|
||||
createFlags.String(
|
||||
detachKeys := createFlags.String(
|
||||
"detach-keys", define.DefaultDetachKeys,
|
||||
"Override the key sequence for detaching a container. Format is a single character `[a-Z]` or a comma separated sequence of `ctrl-<value>`, where `<value>` is one of: `a-z`, `@`, `^`, `[`, `\\`, `]`, `^` or `_`",
|
||||
)
|
||||
// Clear the default, the value specified in the config file should have the
|
||||
// priority
|
||||
*detachKeys = ""
|
||||
|
||||
createFlags.StringSlice(
|
||||
"device", []string{},
|
||||
"Add a host device to the container (default [])",
|
||||
|
||||
@@ -36,6 +36,9 @@ func init() {
|
||||
flags := execCommand.Flags()
|
||||
flags.SetInterspersed(false)
|
||||
flags.StringVar(&execCommand.DetachKeys, "detach-keys", define.DefaultDetachKeys, "Select the key sequence for detaching a container. Format is a single character [a-Z] or ctrl-<value> where <value> is one of: a-z, @, ^, [, , or _")
|
||||
// Clear the default, the value specified in the config file should have the
|
||||
// priority
|
||||
execCommand.DetachKeys = ""
|
||||
flags.StringArrayVarP(&execCommand.Env, "env", "e", []string{}, "Set environment variables")
|
||||
flags.BoolVarP(&execCommand.Interactive, "interactive", "i", false, "Keep STDIN open even if not attached")
|
||||
flags.BoolVarP(&execCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
|
||||
|
||||
@@ -35,6 +35,9 @@ func init() {
|
||||
startCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := startCommand.Flags()
|
||||
flags.BoolVarP(&startCommand.Attach, "attach", "a", false, "Attach container's STDOUT and STDERR")
|
||||
// Clear the default, the value specified in the config file should have the
|
||||
// priority
|
||||
startCommand.DetachKeys = ""
|
||||
flags.StringVar(&startCommand.DetachKeys, "detach-keys", define.DefaultDetachKeys, "Select the key sequence for detaching a container. Format is a single character `[a-Z]` or a comma separated sequence of `ctrl-<value>`, where `<value>` is one of: `a-z`, `@`, `^`, `[`, `\\`, `]`, `^` or `_`")
|
||||
flags.BoolVarP(&startCommand.Interactive, "interactive", "i", false, "Keep STDIN open even if not attached")
|
||||
flags.BoolVarP(&startCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
|
||||
|
||||
Reference in New Issue
Block a user