From e5ba0d9d9c3e29de9a4219a4037e477aa1a77581 Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Tue, 2 Mar 2021 11:51:03 +0900 Subject: [PATCH] Support multibyte characters in `Files` pane --- pkg/commands/loading_files.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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