diff options
author | Ryooooooga <ryoga_314@yahoo.co.jp> | 2021-03-02 11:51:03 +0900 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-03-13 11:02:31 +1100 |
commit | e5ba0d9d9c3e29de9a4219a4037e477aa1a77581 (patch) | |
tree | 903cd622c2a4f513febd168b80638aa4c70db736 | |
parent | 50e4e9d58da73abbd0a80239d6917e6753ee78ae (diff) |
Support multibyte characters in `Files` pane
-rw-r--r-- | pkg/commands/loading_files.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/commands/loading_files.go b/pkg/commands/loading_files.go index 8d68d269e..be6d58ab2 100644 --- a/pkg/commands/loading_files.go +++ b/pkg/commands/loading_files.go @@ -72,7 +72,13 @@ func (c *GitCommand) GitStatus(opts GitStatusOptions) (string, error) { noRenamesFlag = "--no-renames" } - return c.OSCommand.RunCommandWithOutput("git status %s --porcelain %s", opts.UntrackedFilesArg, noRenamesFlag) + statusLines, err := c.OSCommand.RunCommandWithOutput("git status %s --porcelain -z %s", opts.UntrackedFilesArg, noRenamesFlag) + if err != nil { + return "", err + } + + statusLines = strings.Replace(statusLines, "\x00", "\n", -1) + return statusLines, nil } // MergeStatusFiles merge status files |