Skip to content

Commit 2e20791

Browse files
authored
Make the link clickable only on a tty (ruby#1637)
Fix ruby#1165 (comment)
1 parent b37aaf2 commit 2e20791

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/rdoc/rdoc.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,9 @@ def generate
507507
Dir.chdir @options.op_dir do
508508
unless @options.quiet then
509509
$stderr.puts "\nGenerating #{@generator.class.name.sub(/^.*::/, '')} format into #{Dir.pwd}..."
510-
$stderr.puts "\nYou can visit the home page at: \e]8;;file://#{Dir.pwd}/index.html\e\\file://#{Dir.pwd}/index.html\e]8;;\e\\"
510+
uri = "file://#{Dir.pwd}/index.html"
511+
ref = $stderr.tty? ? "\e]8;;#{uri}\e\\#{uri}\e]8;;\e\\" : uri
512+
$stderr.puts "\nYou can visit the home page at: #{ref}"
511513
end
512514

513515
@generator.generate

0 commit comments

Comments
 (0)