-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Cleanup processes #20
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mikew
commented
Oct 12, 2024
Comment on lines
+100
to
+102
// We don't want the ssh process ending too early, if it does we can't | ||
// clean up the remote nvim instance. | ||
exec_helpers.PrepareForForking(remoteCmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obvious in hindsight, but this breaks logging in via password since the "enter password" bit isn't shown in a terminal.
:(
Merged
mikew
added a commit
that referenced
this pull request
Oct 13, 2024
In #20 I changed the SSH process so it wasn't part of the process group. That was so `ctrl-c` wouldn't immediately close the SSH process and prevent nvrh from sending a command to the remote neovim instance and close it. While that works, it also means that the password prompt isn't shown for users that don't have an SSH agent / pubkey auth. Since it only applies to `ctrl-c`, and I don't even think it works on Windows, I'm fine with disabling it until a better solution is found. This also switches to `slog` because I need more logging levels than "print" and "fatal", and adds a `--debug` flag which shows much more output. ## Preview When `--debug` is passed ``` [11:42:20.531] INFO: Starting remote nvim { "nvimCommandString": " nvim --headless --listen \"/tmp/nvrh-socket-1728830540\" --cmd \"cd Work/nvrh-demo-app\"; [ true = true ] \u0026\u0026 rm -f \"/tmp/nvrh-socket-1728830540\"", "source": { "file": "/Users/mike/Work/nvrh/src/ssh_helpers/main.go", "function": "nvrh/src/ssh_helpers.BuildRemoteNvimCmd", "line": 15 } } Pseudo-terminal will not be allocated because stdin is not a terminal. tput: No value for $TERM and no -T specified tput: No value for $TERM and no -T specified tput: No value for $TERM and no -T specified tput: No value for $TERM and no -T specified channel 2: open failed: connect failed: open failed [11:42:22.311] INFO: Connected to nvim { "source": { "file": "/Users/mike/Work/nvrh/src/client/main.go", "function": "nvrh/src/client.init.func1.2", "line": 171 } } [11:42:22.458] INFO: Starting local editor { "cmd": [ "/Applications/Neovide.app/Contents/MacOS/neovide", "--server", "/var/folders/09/gc_fhm_97csc0w2hlb2wmq_80000gn/T/nvrh-socket-1728830540" ], "source": { "file": "/Users/mike/Work/nvrh/src/client/main.go", "function": "nvrh/src/client.BuildClientNvimCmd", "line": 232 } } 2024-10-13 11:42:49.822 neovide[95990:8906209] +[IMKClient subclass]: chose IMKClient_Legacy 2024-10-13 11:42:49.822 neovide[95990:8906209] +[IMKInputSession subclass]: chose IMKInputSession_Legacy [11:42:53.394] INFO: Local editor exited { "source": { "file": "/Users/mike/Work/nvrh/src/client/main.go", "function": "nvrh/src/client.init.func1.2", "line": 197 } } [11:42:53.395] INFO: Closing nvrh { "source": { "file": "/Users/mike/Work/nvrh/src/client/main.go", "function": "nvrh/src/client.init.func1", "line": 214 } } [11:42:53.395] INFO: Closing nvim { "source": { "file": "/Users/mike/Work/nvrh/src/client/main.go", "function": "nvrh/src/client.closeNvimSocket", "line": 369 } } [11:42:53.395] ERROR: Error closing remote nvim { "err": "msgpack/rpc: session closed", "source": { "file": "/Users/mike/Work/nvrh/src/client/main.go", "function": "nvrh/src/client.closeNvimSocket", "line": 371 } } [11:42:53.395] DEBUG: Killing command { "cmd": [ "ssh", "-L", "/var/folders/09/gc_fhm_97csc0w2hlb2wmq_80000gn/T/nvrh-socket-1728830540:/tmp/nvrh-socket-1728830540", "-t", "vscode-remote", "$SHELL -i -c ' nvim --headless --listen \"/tmp/nvrh-socket-1728830540\" --cmd \"cd Work/nvrh-demo-app\"; [ true = true ] \u0026\u0026 rm -f \"/tmp/nvrh-socket-1728830540\"'" ], "source": { "file": "/Users/mike/Work/nvrh/src/client/main.go", "function": "nvrh/src/client.killAllCmds", "line": 355 } } [11:42:53.395] DEBUG: Killing command { "cmd": [ "/Applications/Neovide.app/Contents/MacOS/neovide", "--server", "/var/folders/09/gc_fhm_97csc0w2hlb2wmq_80000gn/T/nvrh-socket-1728830540" ], "source": { "file": "/Users/mike/Work/nvrh/src/client/main.go", "function": "nvrh/src/client.killAllCmds", "line": 355 } } [11:42:53.395] ERROR: Error killing command { "err": "os: process already finished", "source": { "file": "/Users/mike/Work/nvrh/src/client/main.go", "function": "nvrh/src/client.killAllCmds", "line": 358 } } ``` Without `--debug` ``` [11:43:32.096] INFO: Starting remote nvim { "nvimCommandString": " nvim --headless --listen \"/tmp/nvrh-socket-1728830612\" --cmd \"cd Work/nvrh-demo-app\"; [ true = true ] \u0026\u0026 rm -f \"/tmp/nvrh-socket-1728830612\"" } [11:43:33.827] INFO: Connected to nvim [11:43:33.962] INFO: Starting local editor { "cmd": [ "/Applications/Neovide.app/Contents/MacOS/neovide", "--server", "/var/folders/09/gc_fhm_97csc0w2hlb2wmq_80000gn/T/nvrh-socket-1728830612" ] } [11:43:45.095] INFO: Local editor exited [11:43:45.095] INFO: Closing nvrh [11:43:45.095] INFO: Closing nvim [11:43:45.095] ERROR: Error closing remote nvim { "err": "msgpack/rpc: session closed" } [11:43:45.095] ERROR: Error killing command { "err": "os: process already finished" } ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1