1
0
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:
Jesse Duffield
2020-04-15 20:30:24 +10:00
committed by github-actions[bot]
parent fcdcd1c335
commit 2974a57943
10 changed files with 57 additions and 135 deletions

View File

@ -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)
}