Skip to content

Feature/913 link opening confirmation optional#940

Open
aanthoonyy wants to merge 1 commit into
pwmt:developfrom
aanthoonyy:feature/913-link-opening-confirmation-optional
Open

Feature/913 link opening confirmation optional#940
aanthoonyy wants to merge 1 commit into
pwmt:developfrom
aanthoonyy:feature/913-link-opening-confirmation-optional

Conversation

@aanthoonyy

Copy link
Copy Markdown

Link to original feature request

939

Overview

Add a configuration option for skipping the confirmation dialog when opening external links in a document

:set disable-link-confirm false is default and keeps behavior the same as before which was providing a dialog that can be accepted by 'y' or 'enter' but anything else cancels opening the link in the browser

set disable-link-confirm true removes the dialogue prompt and just opens the link in the browser

Changes

  • Added the setting via girara_setting_add in config.c
  • Updated cb_link_confirm to allow entry to be NULL in links.c
  • Updated link_confirm_spawn to pass entry in as NULL to cb_link_confirm in the event that disable_link_confirm is true

@aanthoonyy

Copy link
Copy Markdown
Author

I found that there are a handful of ways to implement this, so if there is a better way to implement this let me know.

I will wait for it to get unblocked by the gtk4 port, once that gtk4 port is merged I'll make the needed changes to this branch.

@valoq

valoq commented Jun 3, 2026

Copy link
Copy Markdown
Contributor
  • The disable-link-confirm setting turns off the prompt for all external link types, including launch and remote links, not just web links. It should only skip the prompt for URI (web) links and keep confirming launch and remote links.

  • cb_link_confirm now treats a NULL entry as "confirmed" and opens the link instead of cancelling. Handle the disabled case in zathura_link_evaluate and leave cb_link_confirm unchanged. The comment above cb_link_confirm is also now wrong.

  • The name disable-link-confirm is a double negative and is confusing. a positive name such as link-confirm with default true may be better.

@aanthoonyy

Copy link
Copy Markdown
Author

@valoq thanks for the feedback, thoughts on me putting the check in the ZATHURA_LINK_URI case?

@valoq

valoq commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

@valoq thanks for the feedback, thoughts on me putting the check in the ZATHURA_LINK_URI case?

Looks ok to me. clang format is complaining though, the spacing is a bit off.

@aanthoonyy

Copy link
Copy Markdown
Author

I need to fix my formatter on my config at some point

I have a question on your comment since I'm relatively new to C

* cb_link_confirm now treats a NULL entry as "confirmed" and opens the link instead of cancelling. Handle the disabled case in zathura_link_evaluate and leave cb_link_confirm unchanged. The comment above cb_link_confirm is also now wrong.

I do react stuff at work, and if you had something in your component that was null, react will just skip over rendering. My thought going in to this was if you pass entry in as null, you'll know that no input is expected to be read and you can just move onto opening your link. Is this idea no relevant to C code?

@aanthoonyy

Copy link
Copy Markdown
Author

Also I noticed on your gtk4 pr you combined your commits into one, is that what is expected when committing to zathura?

@sebastinas

Copy link
Copy Markdown
Member

There is no clear rule on that. In some cases it makes sense to squash the commits, sometimes not. In this case, as the commits fix up issues in earlier commits of the PR, I would prefer that the commits be squashed. But let's wait with that until we landed the Gtk 4 PR.

@aanthoonyy

Copy link
Copy Markdown
Author

Sounds good

@sebastinas

Copy link
Copy Markdown
Member

@aanthoonyy Please rebase on current develop and squash the commits.

@aanthoonyy aanthoonyy force-pushed the feature/913-link-opening-confirmation-optional branch from b6c39a3 to 11b33d5 Compare June 18, 2026 02:28
@aanthoonyy aanthoonyy force-pushed the feature/913-link-opening-confirmation-optional branch from bd74fa1 to ed465ea Compare June 18, 2026 02:37
@aanthoonyy

Copy link
Copy Markdown
Author

@sebastinas Okay, this should be good...

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.

3 participants