Skip to content

Commit

Permalink
fix: Strange 255 exit code on Windows (#19)
Browse files Browse the repository at this point in the history
The video in #18 clearly shows nvrh
working on Windows, but when I tried it on my fairly stock gaming PC, I
was getting an error.

So I turned on stdio for the ssh process, saw nothing weird, and it
worked.

## Preview



https://github.com/user-attachments/assets/3bd1814b-3966-472f-92d7-a7cc074af751
  • Loading branch information
mikew authored Oct 11, 2024
1 parent 8ec97d3 commit 438df45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ CATEGORY:
client
OPTIONS:
--use-ports Use ports instead of sockets. Defaults to true on Windows (default: false) [$NVRH_CLIENT_USE_PORTS]
--server-env value [ --server-env value ] Environment variables to set on the remote server
--local-editor {{SOCKET_PATH}} [ --local-editor {{SOCKET_PATH}} ] Local editor to use. {{SOCKET_PATH}} will be replaced with the socket path (default: "nvim", "--server", "{{SOCKET_PATH}}", "--remote-ui")
--help, -h show help
Expand Down
3 changes: 2 additions & 1 deletion src/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ var CliClientOpenCommand = cli.Command{
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "use-ports",
Usage: "Use ports instead of sockets",
Usage: "Use ports instead of sockets. Defaults to true on Windows",
EnvVars: []string{"NVRH_CLIENT_USE_PORTS"},
Value: runtime.GOOS == "windows",
},

&cli.StringSliceFlag{
Expand Down
6 changes: 5 additions & 1 deletion src/ssh_helpers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import (
"fmt"
"log"
"nvrh/src/context"
"os"
"os/exec"
"runtime"
"strings"

"github.com/neovim/go-client/nvim"
Expand All @@ -30,7 +32,9 @@ func StartRemoteNvim(nvrhContext context.NvrhContext) {
fmt.Sprintf("$SHELL -i -c '%s'", nvimCommand),
)

// sshCommand.Stdout = os.Stdout
if runtime.GOOS == "windows" {
sshCommand.Stdout = os.Stdout
}
// sshCommand.Stderr = os.Stderr
// sshCommand.Stdin = os.Stdin

Expand Down

0 comments on commit 438df45

Please sign in to comment.