summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-12-18 22:23:17 +1100
committerJesse Duffield <jessedduffield@gmail.com>2018-12-18 22:23:17 +1100
commit20a94447d7bad91848ae75b391eaf6feb92e10c4 (patch)
tree95174d3b5500db20637c8199d7d0f7367de5dfbc
parent865c7c2332d71704b8a6bc22472313daf4997f16 (diff)
explicitly return newlines to our live command stdin
-rw-r--r--pkg/commands/exec_live_default.go5
-rw-r--r--pkg/commands/git.go2
-rw-r--r--pkg/commands/git_test.go2
-rw-r--r--pkg/gui/credentials_panel.go8
4 files changed, 5 insertions, 12 deletions
diff --git a/pkg/commands/exec_live_default.go b/pkg/commands/exec_live_default.go
index bce912160..a61b5f398 100644
--- a/pkg/commands/exec_live_default.go
+++ b/pkg/commands/exec_live_default.go
@@ -41,10 +41,7 @@ func RunCommandWithOutputLiveWrapper(c *OSCommand, command string, output func(s
scanner.Split(scanWordsWithNewLines)
for scanner.Scan() {
toOutput := strings.Trim(scanner.Text(), " ")
- toWrite := output(toOutput)
- if len(toWrite) > 0 {
- _, _ = ptmx.WriteString(toWrite + "\n")
- }
+ _, _ = ptmx.WriteString(output(toOutput))
}
}()
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index e708d5c55..a1f01e422 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -266,7 +266,7 @@ func (c *GitCommand) Fetch(unamePassQuestion func(string) string, canAskForCrede
if canAskForCredentials {
return unamePassQuestion(question)
}
- return "-"
+ return "\n"
})
}
diff --git a/pkg/commands/git_test.go b/pkg/commands/git_test.go
index 2413976fc..2302391ec 100644
--- a/pkg/commands/git_test.go
+++ b/pkg/commands/git_test.go
@@ -1045,7 +1045,7 @@ func TestGitCommandPush(t *testing.T) {
gitCmd := newDummyGitCommand()
gitCmd.OSCommand.command = s.command
err := gitCmd.Push("test", s.forcePush, func(passOrUname string) string {
- return "-"
+ return "\n"
})
s.test(err)
})
diff --git a/pkg/gui/credentials_panel.go b/pkg/gui/credentials_panel.go
index 6c8f8b4ef..dd5461441 100644
--- a/pkg/gui/credentials_panel.go
+++ b/pkg/gui/credentials_panel.go
@@ -30,15 +30,11 @@ func (gui *Gui) waitForPassUname(g *gocui.Gui, currentView *gocui.View, passOrUn
// wait for username/passwords input
userInput := <-gui.credentials
- return userInput
+ return userInput + "\n"
}
func (gui *Gui) handleSubmitCredential(g *gocui.Gui, v *gocui.View) error {
message := gui.trimmedContent(v)
- if message == "" {
- // sending an obviously incorrect password so that the program isn't stuck waiting
- message = "-"
- }
gui.credentials <- message
err := gui.refreshFiles(g)
if err != nil {
@@ -70,7 +66,7 @@ func (gui *Gui) handleCloseCredentialsView(g *gocui.Gui, v *gocui.View) error {
return err
}
- gui.credentials <- "-"
+ gui.credentials <- ""
return gui.switchFocus(g, nil, gui.getFilesView(g))
}