Skip to content

Commit 1e091ce

Browse files
committed
We should use stdout to print greeting message in attach mode because gksudo swallows stderr.
1 parent 2dc4480 commit 1e091ce

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

bin/gdb_wrapper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ options.gems_to_include.each do |gem_path|
7272
end
7373

7474
require 'ruby-debug-ide/greeter'
75-
Debugger::print_greeting_msg(nil, nil)
75+
Debugger::print_greeting_msg($stdout, nil, nil)
7676

7777
require 'ruby-debug-ide/attach/util'
7878
require 'ruby-debug-ide/attach/native_debugger'

lib/ruby-debug-ide.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def start_control(host, port, notify_dispatcher)
111111
# "localhost" and nil have problems on some systems.
112112
host ||= '127.0.0.1'
113113
server = TCPServer.new(host, port)
114-
print_greeting_msg(host, port)
114+
print_greeting_msg($stderr, host, port)
115115
notify_dispatcher(port) if notify_dispatcher
116116
while (session = server.accept)
117117
$stderr.puts "Connected from #{session.peeraddr[2]}" if Debugger.cli_debug

lib/ruby-debug-ide/greeter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
module Debugger
1111

1212
class << self
13-
def print_greeting_msg(host, port)
13+
def print_greeting_msg(stream, host, port)
1414
base_gem_name = if defined?(JRUBY_VERSION) || RUBY_VERSION < '1.9.0'
1515
'ruby-debug-base'
1616
elsif RUBY_VERSION < '2.0.0'
@@ -33,7 +33,7 @@ def print_greeting_msg(host, port)
3333

3434
msg = "Fast Debugger (ruby-debug-ide #{IDE_VERSION}, #{base_gem_name} #{VERSION}, file filtering is #{file_filtering_support})" + listens_on
3535

36-
$stderr.printf msg
36+
stream.printf msg
3737
end
3838
end
3939

0 commit comments

Comments
 (0)