-
Notifications
You must be signed in to change notification settings - Fork 129
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
edit command does not work with Panic Nova #726
Comments
https://github.com/ruby/debug/blob/master/lib/debug/thread_client.rb#L646 It only calls |
Please reopen it if you find another ideas. |
@ko1 Thanks for your response, I have figured out the issue. I have set The problem is calling system('nova', '-w', FILE_PATH)
system("nova -w #{FILE_PATH}") I am happy to make a pull request to suggest this change to the debug source you mention if it makes sense to you. Othewrise if this behavior seems wrong by Panic Nova, I can file a support ticket with them, they are usually responsive. |
Ah I see. It is a bug of debug.gem. |
Maybe we should diff --git a/lib/debug/thread_client.rb b/lib/debug/thread_client.rb
index 5f2d100..858fc0d 100644
--- a/lib/debug/thread_client.rb
+++ b/lib/debug/thread_client.rb
@@ -2,6 +2,7 @@
require 'objspace'
require 'pp'
+require 'shellwords'
require_relative 'color'
@@ -643,7 +644,7 @@ module DEBUGGER__
if editor = (ENV['RUBY_DEBUG_EDITOR'] || ENV['EDITOR'])
puts "command: #{editor}"
puts " path: #{path}"
- system(editor, path)
+ system(*Shellwords.split(editor), path)
else
puts "can not find editor setting: ENV['RUBY_DEBUG_EDITOR'] or ENV['EDITOR']"
end |
@adam12 That seems reasonable to me. Would be happy to see this included in next release. I'm happy to PR your diff if you are too busy but figured you might want the credit since you've pretty much done the work here 😄. |
@mzagaja If it the patch works for you, definitely go ahead and submit a PR using it :) |
When typing “edit” into the debugger, Panic Nova would not wait because it requires the -w flag, and the call to system was not respecting it. This commit uses the Shellwords.split method to separate it into another argument for system so Nova or other editors that require a flag work properly.
I tested this locally and it worked great. PR submitted. |
Your environment
Describe the bug
When I type
edit
into Ruby debug, it outputs the command information, but does not actually open the editor with the file.To Reproduce
Expected behavior
I expected the file the debugger is open in to open in Panic Nova.
The text was updated successfully, but these errors were encountered: