-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add clipboard support & feature to copy container id #584
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -358,6 +358,20 @@ func (gui *Gui) PauseContainer(container *commands.Container) error { | |
}) | ||
} | ||
|
||
func (gui *Gui) handleCopyContainerId(g *gocui.Gui, v *gocui.View) error { | ||
ctr, err := gui.Panels.Containers.GetSelectedItem() | ||
if err != nil { | ||
return nil | ||
} | ||
|
||
err = gui.WithStaticWaitingStatus(fmt.Sprintf(gui.Tr.CopyContainerIdStatus, utils.TruncateWithEllipsis(ctr.ID, 10)), time.Second*2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't really a waiting status: it's a toast message. We should update the naming to reflect that (and I haven't tested it locally but it's important we don't show a loading spinner on this) |
||
if err != nil { | ||
return err | ||
} | ||
|
||
return gui.OSCommand.CopyToClipboard(ctr.ID) | ||
} | ||
|
||
func (gui *Gui) handleContainerPause(g *gocui.Gui, v *gocui.View) error { | ||
ctr, err := gui.Panels.Containers.GetSelectedItem() | ||
if err != nil { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that removeStatus tries to obtain the lock that addWaitingStatus already holds, wouldn't that cause a deadlock?