Skip to content

Commit

Permalink
Change the link? method to extract VTE version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Aug 10, 2024
1 parent 2a99300 commit 20cfb7f
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions lib/tty/link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,7 @@ def link?

return iterm_version? if iterm? && term_program_version

if vte?
current_semantic_version = semantic_version(vte_version)

return current_semantic_version >= semantic_version(0, 50, 1)
end
return vte_version? if vte?

false
end
Expand Down Expand Up @@ -247,6 +243,21 @@ def vte?
!vte_version.nil?
end

# Detect whether the VTE version supports terminal hyperlinks
#
# @example
# link.vte_version?
# # => true
#
# @return [Boolean]
#
# @api private
def vte_version?
current_semantic_version = semantic_version(vte_version)

current_semantic_version >= semantic_version(0, 50, 1)
end

# Create a {TTY::Link::SemanticVersion} instance from a version value
#
# @example
Expand Down

0 comments on commit 20cfb7f

Please sign in to comment.