From 2e2079159a9e827b94d3c3b468bfd58a8c524ff6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 7 Mar 2026 16:23:01 +0900 Subject: [PATCH] Make the link clickable only on a tty (#1637) Fix https://github.com/ruby/rdoc/pull/1165#issuecomment-4015747997 --- lib/rdoc/rdoc.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb index 415abea520..f14db7c2c7 100644 --- a/lib/rdoc/rdoc.rb +++ b/lib/rdoc/rdoc.rb @@ -507,7 +507,9 @@ def generate Dir.chdir @options.op_dir do unless @options.quiet then $stderr.puts "\nGenerating #{@generator.class.name.sub(/^.*::/, '')} format into #{Dir.pwd}..." - $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\\" + uri = "file://#{Dir.pwd}/index.html" + ref = $stderr.tty? ? "\e]8;;#{uri}\e\\#{uri}\e]8;;\e\\" : uri + $stderr.puts "\nYou can visit the home page at: #{ref}" end @generator.generate