Add Ghostty terminal hyperlink support#3
Add Ghostty terminal hyperlink support#3the-spectator wants to merge 2 commits intopiotrmurach:masterfrom
Conversation
piotrmurach
left a comment
There was a problem hiding this comment.
Hi Akshay,
Thank you for submitting this PR. 🙏
I'm all in favour of adding Ghostty support. I left a couple of comments, though. In particular, I'm curious about the version check. Would you have time to investigate?
33e1270 to
7778e6f
Compare
|
Thanks for the review @piotrmurach ! I have updated the code as per review comments. |
piotrmurach
left a comment
There was a problem hiding this comment.
Thank you for making the changes. We are nearly there.
5f9fbed to
f7ab9bb
Compare
|
Friendly bump for review. |
piotrmurach
left a comment
There was a problem hiding this comment.
@the-spectator Sorry for the delay in my review.
I went through all the changes. Most comments relate to tests to ensure consistency in formatting and ordering. I included an extra test to match the other terminal tests.
Once this is merged, I plan to make a couple more changes to link rendering before making a new release.
| @@ -0,0 +1,67 @@ | |||
| # frozen_string_literal: true | |||
|
|
|||
| RSpec.describe TTY::Link::Terminals::Ghostty, "#link?" do | |||
There was a problem hiding this comment.
Sorry for messing you around with this. I looked at other terminal tests. Let's keep the order consistent. So the naming and order should be:
"doesn't support links without the term program...""doesn't support links without a terminal program name""doesn't support links with a non-Ghostty program name""supports links above the 2.0.0 version"NEW test with2.3.4version."supports links above the 1.0.0 version""supports links on the 1.0.0 version""supports links on the 1.0.0 version with a mixed-case program name""doesn't support links below the 1.0.0 version""doesn't support links without a version""doesn't support links without the term program version env variable"
spec/unit/terminals/ghostty_spec.rb
Outdated
| end | ||
|
|
||
| it "doesn't support links with a non-Ghostty program name" do | ||
| env = {"TERM_PROGRAM" => "other-terminal", "TERM_PROGRAM_VERSION" => "1.0.0"} |
There was a problem hiding this comment.
| env = {"TERM_PROGRAM" => "other-terminal", "TERM_PROGRAM_VERSION" => "1.0.0"} | |
| env = {"TERM_PROGRAM" => "other-terminal"} |
spec/unit/terminals/ghostty_spec.rb
Outdated
| expect(ghostty.link?).to eq(false) | ||
| end | ||
|
|
||
| it "supports links with the Ghostty program name" do |
There was a problem hiding this comment.
| it "supports links with the Ghostty program name" do | |
| it "supports links on the 1.0.0 version" do |
spec/unit/terminals/ghostty_spec.rb
Outdated
| expect(ghostty.link?).to eq(true) | ||
| end | ||
|
|
||
| it "supports links with the Ghostty program name in mixed case" do |
There was a problem hiding this comment.
| it "supports links with the Ghostty program name in mixed case" do | |
| it "supports links on the 1.0.0 version with a mixed-case program name" do |
spec/unit/terminals/ghostty_spec.rb
Outdated
| expect(ghostty.link?).to eq(true) | ||
| end | ||
|
|
||
| it "doesn't supports links without the term program version env variable" do |
There was a problem hiding this comment.
| it "doesn't supports links without the term program version env variable" do | |
| it "doesn't support links without the term program version env variable" do |
spec/unit/terminals/ghostty_spec.rb
Outdated
| end | ||
|
|
||
| it "doesn't supports links below version 1.0.0" do | ||
| env = env_with_name.merge({"TERM_PROGRAM_VERSION" => "0.9.0"}) |
There was a problem hiding this comment.
| env = env_with_name.merge({"TERM_PROGRAM_VERSION" => "0.9.0"}) | |
| env = env_with_name.merge({"TERM_PROGRAM_VERSION" => "0.9.2"}) |
spec/unit/terminals/ghostty_spec.rb
Outdated
| end | ||
|
|
||
| it "supports links above the 1.0.0 version" do | ||
| env = env_with_name.merge({"TERM_PROGRAM_VERSION" => "1.1.0"}) |
There was a problem hiding this comment.
| env = env_with_name.merge({"TERM_PROGRAM_VERSION" => "1.1.0"}) | |
| env = env_with_name.merge({"TERM_PROGRAM_VERSION" => "1.0.1"}) |
spec/unit/link_spec.rb
Outdated
|
|
||
| context "when Ghostty" do | ||
| it "supports links above the 1.0.0 version" do | ||
| env = {"TERM_PROGRAM" => "ghostty", "TERM_PROGRAM_VERSION" => "1.0.1"} |
There was a problem hiding this comment.
| env = {"TERM_PROGRAM" => "ghostty", "TERM_PROGRAM_VERSION" => "1.0.1"} | |
| env = { | |
| "TERM_PROGRAM" => "ghostty", | |
| "TERM_PROGRAM_VERSION" => "1.0.1" | |
| } |
CHANGELOG.md
Outdated
| * Add hyperlink support detection in Ghostty terminal | ||
| by Akshay Birajdar (@the-spectator). |
There was a problem hiding this comment.
| * Add hyperlink support detection in Ghostty terminal | |
| by Akshay Birajdar (@the-spectator). | |
| * Add hyperlink support detection for the Ghostty terminal | |
| by Akshay Birajdar (@the-spectator). |
lib/tty/link/terminals/ghostty.rb
Outdated
| !(term_program =~ GHOSTTY).nil? | ||
| end | ||
|
|
||
| # Detect any Ghostty terminal version to support terminal hyperlinks |
There was a problem hiding this comment.
This is no longer true. Let's change to:
| # Detect any Ghostty terminal version to support terminal hyperlinks | |
| # Detect whether the Ghostty version supports terminal hyperlinks |
f7ab9bb to
5337e2f
Compare
|
Thanks for the review @piotrmurach ! I have addressed the review comments. |
Closes #2
Describe the change
Add Ghostty terminal hyperlink support
Why are we doing this?
To extend the supported terminal list.
Requirements
masterbranch?