urls: initial support for detecting URLs and rendering jump-labels

The jump labels work, but is currently hardcoded to use xdg-open
This commit is contained in:
Daniel Eklöf 2021-01-31 11:12:07 +01:00
parent b255aea3ed
commit 2cc84db979
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
12 changed files with 503 additions and 28 deletions

13
input.c
View file

@ -34,6 +34,7 @@
#include "spawn.h"
#include "terminal.h"
#include "tokenize.h"
#include "url-mode.h"
#include "util.h"
#include "vt.h"
#include "xmalloc.h"
@ -272,8 +273,11 @@ execute_binding(struct seat *seat, struct terminal *term,
}
case BIND_ACTION_SHOW_URLS:
assert(false);
break;
xassert(!urls_mode_is_active(term));
urls_collect(term);
render_refresh_urls(term);
return true;
case BIND_ACTION_SELECT_BEGIN:
selection_start(
@ -854,6 +858,11 @@ key_press_release(struct seat *seat, struct terminal *term, uint32_t serial,
start_repeater(seat, key);
search_input(seat, term, key, sym, effective_mods, serial);
return;
} else if (urls_mode_is_active(term)) {
if (should_repeat)
start_repeater(seat, key);
urls_input(seat, term, key, sym, effective_mods, serial);
return;
}
#if 0