Skip to content

Commit 13b1441

Browse files
authored
Merge pull request #514 from athityakumar/fix-hyperlink-non-ascii
2 parents cadb9b9 + 0c6928d commit 13b1441

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/colorls/core.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ def fetch_string(content, key, color, increment)
339339
@count[increment] += 1
340340
value = increment == :folders ? @folders[key] : @files[key]
341341
logo = value.gsub(/\\u[\da-f]{4}/i) { |m| [m[-4..].to_i(16)].pack('U') }
342-
name = content.show
343-
name = make_link(content) if @hyperlink
342+
name = @hyperlink ? make_link(content) : content.show
344343
name += content.directory? && @indicator_style != 'none' ? '/' : ' '
345344
entry = "#{out_encode(logo)} #{out_encode(name)}"
346345
entry = entry.bright if !content.directory? && content.executable?
@@ -428,7 +427,7 @@ def tree_branch_preprint(prespace, indent, prespace_icon)
428427

429428
def make_link(content)
430429
uri = Addressable::URI.convert_path(File.absolute_path(content.path))
431-
"\033]8;;#{uri}\007#{content.name}\033]8;;\007"
430+
"\033]8;;#{uri}\007#{content.show}\033]8;;\007"
432431
end
433432
end
434433
end

0 commit comments

Comments
 (0)