Skip to content

Conversation

@the-spectator
Copy link

Closes #2

Describe the change

Add Ghostty terminal hyperlink support

Why are we doing this?

To extend the supported terminal list.

Requirements

  • Tests written & passing locally?
  • Code style checked?
  • Rebased with master branch?
  • Documentation updated?
  • Changelog updated?

Copy link
Owner

@piotrmurach piotrmurach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

#
# @api private
def version?
true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this accurate? I had a quick look through Ghostty issues, and it appears that version 1.0.0 adds hyperlink support.(see OSC8 Hyperlink Support). Other releases fixed some issues with hyperlinks, notably the 1.2.0. I'm wondering whether we should add a version limit that can be read from the TERM_PROGRAM_VERSION. However, the official first release was 1.0.0, so it may be impossible for people to install an older version. In which case, this would be fine. Any thoughts?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given support is present from Ghostty’s first official release, and later versions mostly fix issues rather than add the feature, returning true seems accurate for now.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't settled on this one yet. I need this decision embedded in the code somehow. One way is to change it to use a version higher than 1.0.0 explicitly. The advantage is that this would serve as a direct explanation to anyone reading, including myself in the future. The alternative is to keep the true value with a comment that says "available since official public release 1.0.0` or similar. What do you reckon?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets codify it. Best documentation is the well written code 😉 .

Comment on lines 48 to 53
it "supports links without a version" do
env = env_with_name.merge({"TERM_PROGRAM_VERSION" => nil})
ghostty = described_class.new(semantic_version, env)

expect(ghostty.link?).to eq(true)
end

it "supports links without the term program version env variable" do
ghostty = described_class.new(semantic_version, env_with_name)

expect(ghostty.link?).to eq(true)
end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's swap these to match the prior tests ordering.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applied the suggested changes.

@the-spectator
Copy link
Author

Thanks for the review @piotrmurach ! I have updated the code as per review comments.

Copy link
Owner

@piotrmurach piotrmurach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes. We are nearly there.

#
# @api private
def version?
true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't settled on this one yet. I need this decision embedded in the code somehow. One way is to change it to use a version higher than 1.0.0 explicitly. The advantage is that this would serve as a direct explanation to anyone reading, including myself in the future. The alternative is to keep the true value with a comment that says "available since official public release 1.0.0` or similar. What do you reckon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supporting Ghostty Terminal

2 participants