mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-15 01:34:26 +02:00
support copying stuff to clipboard
This commit is contained in:
committed by
github-actions[bot]
parent
fcdcd1c335
commit
2974a57943
@ -454,3 +454,14 @@ func RunLineOutputCmd(cmd *exec.Cmd, onLine func(line string) (bool, error)) err
|
||||
cmd.Wait()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *OSCommand) CopyToClipboard(str string) error {
|
||||
commandTemplate := c.Config.GetUserConfig().GetString("os.copyToClipboardCommand")
|
||||
templateValues := map[string]string{
|
||||
"str": c.Quote(str),
|
||||
}
|
||||
|
||||
command := utils.ResolvePlaceholderString(commandTemplate, templateValues)
|
||||
|
||||
return c.RunCommand(command)
|
||||
}
|
||||
|
Reference in New Issue
Block a user