diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-10-16 13:49:40 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-10-16 21:18:43 +1100 |
commit | 87e9d9bdc21ebb38727a04c9df7ef5aadc1eba84 (patch) | |
tree | c7d812f28c0ebe6b11407a1dbed0b313859e74e7 /pkg/commands/oscommands | |
parent | b6454755caf6b90c935f986558f4f9ad085b1837 (diff) |
minor changes
Diffstat (limited to 'pkg/commands/oscommands')
-rw-r--r-- | pkg/commands/oscommands/os.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go index 5a35b9278..b146d9d8e 100644 --- a/pkg/commands/oscommands/os.go +++ b/pkg/commands/oscommands/os.go @@ -546,7 +546,9 @@ func RunLineOutputCmd(cmd *exec.Cmd, onLine func(line string) (bool, error)) err } func (c *OSCommand) CopyToClipboard(str string) error { - c.LogCommand(fmt.Sprintf("Copying '%s' to clipboard", utils.TruncateWithEllipsis(str, 40)), false) + escaped := strings.Replace(str, "\n", "\\n", -1) + truncated := utils.TruncateWithEllipsis(escaped, 40) + c.LogCommand(fmt.Sprintf("Copying '%s' to clipboard", truncated), false) return clipboard.WriteAll(str) } |