diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/commands/os.go | 10 | ||||
-rw-r--r-- | pkg/config/config_default_platform.go | 3 | ||||
-rw-r--r-- | pkg/config/config_linux.go | 3 | ||||
-rw-r--r-- | pkg/config/config_windows.go | 3 |
4 files changed, 5 insertions, 14 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go index 81ebf951a..74bcd1a78 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -14,6 +14,7 @@ import ( "github.com/go-errors/errors" + "github.com/atotto/clipboard" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/mgutz/str" @@ -475,12 +476,5 @@ func RunLineOutputCmd(cmd *exec.Cmd, onLine func(line string) (bool, error)) err } 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) + return clipboard.WriteAll(str) } diff --git a/pkg/config/config_default_platform.go b/pkg/config/config_default_platform.go index 0eccd96ab..df205c0d7 100644 --- a/pkg/config/config_default_platform.go +++ b/pkg/config/config_default_platform.go @@ -7,6 +7,5 @@ func GetPlatformDefaultConfig() []byte { return []byte( `os: openCommand: 'open {{filename}}' - openLinkCommand: 'open {{link}}' - copyToClipboardCommand: 'bash -c "echo -n {{str}} | pbcopy"'`) + openLinkCommand: 'open {{link}}'`) } diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go index 8f3223cfc..2dfbdb1c6 100644 --- a/pkg/config/config_linux.go +++ b/pkg/config/config_linux.go @@ -5,6 +5,5 @@ func GetPlatformDefaultConfig() []byte { return []byte( `os: openCommand: 'sh -c "xdg-open {{filename}} >/dev/null"' - openLinkCommand: 'sh -c "xdg-open {{link}} >/dev/null"' - copyToClipboardCommand: 'bash -c "echo -n {{str}} | xclip -selection clipboard"'`) + openLinkCommand: 'sh -c "xdg-open {{link}} >/dev/null"'`) } diff --git a/pkg/config/config_windows.go b/pkg/config/config_windows.go index 0c18272f1..6f6560316 100644 --- a/pkg/config/config_windows.go +++ b/pkg/config/config_windows.go @@ -5,6 +5,5 @@ func GetPlatformDefaultConfig() []byte { return []byte( `os: openCommand: 'cmd /c "start "" {{filename}}"' - openLinkCommand: 'cmd /c "start "" {{link}}"' - copyToClipboardCommand: 'cmd \c "echo -n {{str}} > /dev/clipboard"'`) + openLinkCommand: 'cmd /c "start "" {{link}}"'`) } |