aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
* | Merge branch 'url-detection'Daniel Eklöf2021-02-08-138/+1340
|\ \
| * | url-mode: urls_render(): early exit when URL list is emptyDaniel Eklöf2021-02-07-0/+3
| | |
| * | url-mode: generate-key-combos: minor efficiency tweaksDaniel Eklöf2021-02-07-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use a do..while loop; this lets us drop the second half of the loop condition. * Call wcslen(prefix) once, *before* iterating the alphabet characters. * Step through the alphabet characters using a pointer, as this avoids an indexed load (with possibly an imul instruction in e.g. -Os builds).
| * | url-mode: be consistent; use xmalloc() + xrealloc()Daniel Eklöf2021-02-07-4/+4
| | |
| * | url-mode: early exit when assigning key combos to empty listDaniel Eklöf2021-02-07-0/+3
| | |
| * | changelog: URL modeDaniel Eklöf2021-02-07-0/+4
| | |
| * | doc: foot.1: document the new URL modeDaniel Eklöf2021-02-07-0/+25
| | |
| * | readme: document the new URL modeDaniel Eklöf2021-02-07-0/+27
| | |
| * | render: urls: blank out keys already pressedDaniel Eklöf2021-02-07-6/+3
| | |
| * | render: urls: fix string formatter in swprintf()Daniel Eklöf2021-02-07-1/+1
| | |
| * | render: urls: don’t use/allocate maximum allowed characters unless neededDaniel Eklöf2021-02-07-1/+1
| | |
| * | render: render_osd(): remove ‘alpha’ parameter - it’s always 0xffffDaniel Eklöf2021-02-07-8/+6
| | |
| * | url-mode: input: backspace reverts the last keyDaniel Eklöf2021-02-07-2/+11
| | |
| * | url-mode: fix key sequence generationDaniel Eklöf2021-02-07-33/+53
| | | | | | | | | | | | | | | | | | | | | | | | * We were using the ‘back’ element of the list as prefix for the next iteration of sequences, instead of the element at index ‘offset’ * ALEN() on a wchar_t[] includes the NULL terminator. We don’t want that.
| * | render: urls: reduce vertical marginDaniel Eklöf2021-02-07-5/+6
| | |
| * | render: urls: uppercase the activation key sequenceDaniel Eklöf2021-02-07-0/+4
| | |
| * | url-mode: generate key combinations using vimium’s algorithmDaniel Eklöf2021-02-07-16/+47
| | |
| * | url-mode: refresh rendered URLs after accepting a keyDaniel Eklöf2021-02-07-0/+1
| | |
| * | render: urls: add TODO: highlight already entered keysDaniel Eklöf2021-02-07-0/+6
| | |
| * | render: urls: don’t display URLs whose key sequence doesn’t matchDaniel Eklöf2021-02-07-1/+10
| | |
| * | url-mode: urls_assign_key_combos(): remove URLs when all key combos have been used upDaniel Eklöf2021-02-07-15/+24
| | |
| * | url-mode: add ftp://, ftps://, file://, gemini:// and gopher://Daniel Eklöf2021-02-07-0/+5
| | |
| * | url-mode: urls_collect(): URL list pointer as an argumentDaniel Eklöf2021-02-07-54/+60
| | |
| * | url-mode: underline URLs using the color from colors.urlsDaniel Eklöf2021-02-07-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is implemented by allocating one of the (few!) remaining bits in the cells’ attribute struct to indicate the cell should be “URL highlighted”. render_cell() looks at this bit and draws an underline using the color from colors.urls (defaults to regular3 - i.e. yellow). A new function, url_tag_cells(), iterates the currently detected URLs and sets the new ‘url’ attribute flag on the affected cells. Note: this is done in a separate function to keep urls_collect() free from as many dependencies as possible. urls_reset() is updated to *clear* the ‘url’ flag (and thus implicitly also results in a grid refresh, _if_ there were any URLs). We now exit URL mode on *any* client application input. This needs to be so since we can’t know if the URLs we previously detected are still valid.
| * | url-mode: store absolute row numbers in start/end coordinatesDaniel Eklöf2021-02-07-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to update the jump label positions when the viewport changes. This in turn allows us to stay in URL mode while the user is using the mouse to scroll in the scrollback history. Scrolling with the keyboard is currently not possible, since input handling in URL mode does not recognize “regular” key bindings. We _could_ add scrollback up/down bindings to URL mode too, but lets not, for the time being. (Note: an alternative to this patch is to disallow mouse scrolling too. Then we could have kept the URL start/end as viewport local coordinates).
| * | url-mode: make the end coordinate *inclusive*Daniel Eklöf2021-02-07-0/+5
| | |
| * | input: mouse events on jump label surfaces do nothingDaniel Eklöf2021-02-07-0/+4
| | |
| * | term: surface-kind: add TERM_SURF_JUMP_LABELDaniel Eklöf2021-02-07-1/+7
| | |
| * | readme: add URL mode to the feature listDaniel Eklöf2021-02-07-1/+2
| | |
| * | readme: add ctrl+shift+u, with description, to the list of default key bindingsDaniel Eklöf2021-02-07-4/+8
| | |
| * | config: use a bitfield for flags tracking whether to use custom colors for CSD or notDaniel Eklöf2021-02-07-9/+9
| | |
| * | config: add colors.jump_labels and colors.urlsDaniel Eklöf2021-02-07-15/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * colors.jump_labels configures the foreground and background colors used when rendering URL jump labels. Defaults to “regular0 regular3” (i.e. black on yellow). * colors.urls configures the color to use when highlighting URLs in URL mode. Note that we aren’t currently doing any highlighting... Defaults to regular3 (i.e. yellow).
| * | config: use a packed bitfield for “use custom color” flagsDaniel Eklöf2021-02-07-4/+9
| | |
| * | foot.ini: fix default values for csd.button-*-colorDaniel Eklöf2021-02-07-3/+3
| | |
| * | url-mode: refactor: break out URL activation to a separate functionDaniel Eklöf2021-02-07-37/+42
| | |
| * | url-mode: auto-detect: use wcsncasecmp() instead of towlower()Daniel Eklöf2021-02-07-7/+8
| | | | | | | | | | | | | | | When matching the URI scheme, use wcsncasecmp() when comparing the strings, instead of calling towlower() on each cell.
| * | url-mode: auto-detect: don’t store the lower-cased URL; use original casingDaniel Eklöf2021-02-07-5/+5
| | |
| * | config: add show-urls-copy actionDaniel Eklöf2021-02-07-20/+52
| | | | | | | | | | | | | | | | | | This works just like show-urls-launch, except that instead of opening the URL (typically using xdg-open), it is placed in the clipboard when activated.
| * | config: show-urls-launch: change default key binding to ctrl+shift+uDaniel Eklöf2021-02-07-3/+3
| | |
| * | config: rename ‘show-urls’ to ‘show-urls-launch’Daniel Eklöf2021-02-07-6/+7
| | |
| * | render: urls: tweak positioningDaniel Eklöf2021-02-07-4/+6
| | | | | | | | | | | | Don’t offset the labels too much vertically, _or_ horizontally.
| * | render: reduce URL jump label marginsDaniel Eklöf2021-02-07-1/+1
| | |
| * | config: add ctrl+d as (yet another) default binding url-bindings.cancelDaniel Eklöf2021-02-07-2/+3
| | |
| * | url-mode: auto-detect: don’t line-wrap URL is row isn’t line-wrappedDaniel Eklöf2021-02-07-0/+3
| | |
| * | render: url labels: don’t position outside windowDaniel Eklöf2021-02-07-2/+11
| | |
| * | url-mode: auto-detect: heuristics for parenthesis and bracketsDaniel Eklöf2021-02-07-7/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While parenthesis and brackets _are_ valid URL characters, there are many times when we do *not* want them to be part of the URL. For example, in markdown we write “[text](url)”, or even “[![alt-text](url-1)](url-2)”. Here, the URLs are clearly *not* “url)” or “url-1)](url2)”.
| * | url-mode: use ‘url-launch’ from config to open URLsDaniel Eklöf2021-02-07-1/+16
| | |
| * | notify: break out command template expansion to spawn_expand_template()Daniel Eklöf2021-02-07-60/+97
| | |
| * | config: add ‘url-launch’ option, defaulting to “xdg-open ${url}”Daniel Eklöf2021-02-07-22/+63
| | |
| * | term: destroy: set term->window = NULL after destroying itDaniel Eklöf2021-02-07-1/+3
| | | | | | | | | | | | | | | | | | This fixes a crash in urls_reset() on destroy, where we tried to access an already free:d window pointer in order to destroy the jump label surfaces.
| * | render: urls: positioning: place a bit further away from the starting positionDaniel Eklöf2021-02-07-2/+2
| | |
| * | url-mode: urls_reset() do an early return if we don’t have any URLsDaniel Eklöf2021-02-07-0/+3
| | |
| * | url-mode: fix ‘n’ parameter to wcstombs()Daniel Eklöf2021-02-07-4/+8
| | |
| * | urls: initial support for detecting URLs and rendering jump-labelsDaniel Eklöf2021-02-07-28/+503
| | | | | | | | | | | | The jump labels work, but is currently hardcoded to use xdg-open
| * | config: free URL bindingsDaniel Eklöf2021-02-07-0/+5
| | |
| * | config: add infrastructure to handle URL mode specific key bindingsDaniel Eklöf2021-02-07-1/+190
|/ / | | | | | | | | | | * Add “show-urls” action to regular key bindings * Add url-bindings section to foot.ini * Add “cancel” action to URL mode key bindings
* | Merge branch 'xassert-performance-regression-2'Daniel Eklöf2021-02-07-7/+1
|\ \
| * | vt: remove xassert(), that cannot be optimized out, from action_print()Daniel Eklöf2021-02-07-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | action_print() is in the hot path, and having if-statement here *does* have an impact on performance. Much more so when that if-statement involves a functional call to wcwidth(). Closes #330
| * | ime: enter(): remove assertion on surface kind being TERM_SURF_GRIDDaniel Eklöf2021-02-07-5/+1
|/ / | | | | | | | | | | The main surface is the *only* IME capable surface we have. If the compositor is sending an ime::enter event for another surface, it is a compositor bug, not a foot bug.
* | main: include uname.sysname when logging host architectureDaniel Eklöf2021-02-07-1/+2
| |
* | Merge branch 'mouse-events-never-sent-to-client'Daniel Eklöf2021-02-04-109/+89
|\ \
| * | changelog: some mouse events never being sent to the client applicationDaniel Eklöf2021-02-02-0/+7
| | |
| * | selection: remove selection_enabled()Daniel Eklöf2021-02-02-12/+4
| | | | | | | | | | | | | | | Its name did not reflect its semantics. Since it was only used in a single place, “inline” it there, and get rid of it.
| * | input: don’t execute mouse bindings when the application is grabbing the mouseDaniel Eklöf2021-02-02-94/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the application is grabbing the mouse, we require ‘shift’ to be pressed to be able to use foot’s mouse bindings. Otherwise the mouse event is sent to the application. This wasn’t being enforced consistently; each and every mouse **only** action was checking the mouse grab state, but e.g. *primary paste* (which can be used as both a key binding and a mouse binding) was not. The fix is actually quite simple: don’t even try to execute *any* mouse bindings when the application is grabbing the mouse (unless shift is pressed). This fixes an issue where e.g. middle mouse button events (using the default mouse bindings) were never seen by any mouse grabbing client applications.
| * | term: term_mouse_grabbed: return true if mouse tracking is disabledDaniel Eklöf2021-02-02-3/+4
|/ /
* | Merge branch 'reset-term-ime-on-text-input-leave'Daniel Eklöf2021-01-31-0/+8
|\ \
| * | ime: Reset terminal's IME state on text_input.leaveTadeo Kondrak2021-01-30-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | To reproduce issue: - Launch an IME from inside foot - Type in some preedit text - Use Ctrl-C to close the IME - IME text stays in terminal until focus is changed
* | | notify: repair debug log: the parameter has been renamed: msg -> bodyDaniel Eklöf2021-01-31-1/+1
|/ /
* | Merge branch 'releases/1.6'Daniel Eklöf2021-01-29-15/+31
|\|
| * meson/pkgbuild: bump version to 1.6.31.6.3Daniel Eklöf2021-01-29-2/+2
| |
| * changelog: prepare for 1.6.3Daniel Eklöf2021-01-29-3/+1
| |
| * Send text_input_rectangle requests for text-inputTadeo Kondrak2021-01-29-1/+143
| |
| * ci: freebsd: don’t need -Wno-missing-braces anymoreDaniel Eklöf2021-01-29-4/+2
| | | | | | | | builds.sr.ht has been updated to FreeBSD-12.2
| * selection: don’t replace \r\n and \n with \r in bracketed paste modeDaniel Eklöf2021-01-27-3/+14
| |
| * selection: no xassert() in the releases/1.6 branchDaniel Eklöf2021-01-26-1/+1
| |
| * search: match composed characters when extending the search string to the next word boundaryDaniel Eklöf2021-01-26-0/+13
| |
| * search: fix matching of multi-column charactersDaniel Eklöf2021-01-26-3/+14
| | | | | | | | | | We were matching the sub-sequence SPACERs as if they were regular characters, which obviously failed.
| * selection: remove duplicate ‘ESC’ in switch caseDaniel Eklöf2021-01-26-4/+0
| |
| * selection: DEL is 0x7f, not 0x1fDaniel Eklöf2021-01-26-1/+1
| |
| * selection: codespell: stript -> stripDaniel Eklöf2021-01-26-1/+1
| |
| * selection: strip non-formatting C0, BS, HT and DEL from pasted textDaniel Eklöf2021-01-26-0/+19
| |
| * selection: unbreak text/uri-list decoding: we’re not using \r, not \nDaniel Eklöf2021-01-26-1/+1
| | | | | | | | | | | | | | | | Before passing the pasted text to the decoder, we now replace \r\n, and \n, with \r. The URI decoder was looking for a \n, which meant we failed to split up the list and instead pasted a single “multi-line” URI.
| * selection: replace \r\n and \n with \r, and strip \e from pasted textDaniel Eklöf2021-01-26-3/+27
| | | | | | | | | | Closes #305 Closes #306
| * ime: fix rendering of pre-edit cursor when positioned after the pre-edit stringDaniel Eklöf2021-01-26-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | We failed to convert the byte-indices to cell indices, resulting in a box cursor covering the entire pre-edit string. Note that in addition to fixing the translation from byte index to cell index, the rendered had to be updated to dirty one extra cell from the original grid. Without this, we left trailing cursors behind us when the user deleted text from the pre-edit string.
| * search: ad-hoc workaround for combining characters with positive x-offsetsDaniel Eklöf2021-01-26-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | When rendering the search input box, do the same ad-hoc workaround for combining characters with a positive x-offset as we do when rendering normal grid cells. In this case, we don’t *know* when we’re dealing with combining characters. But we can detect zero-width characters. For these, check their glyph’s x-offset. If positive, adjust it like we do when rendering combining glyphs in the main grid, to ensure the glyph is positioned over the _previous_ character, not the next.
| * changelog: high cpu usage while holding down e.g. arrow keys in search modeDaniel Eklöf2021-01-26-0/+2
| |
| * search: don’t re-scan the scrollback unless the search string actually has changedDaniel Eklöf2021-01-26-36/+80
| |
| * search: fix matching against composed charactersDaniel Eklöf2021-01-26-3/+38
| |
| * changelog: search input box no longer accepts non-printablesDaniel Eklöf2021-01-26-0/+1
| |
| * search: filter out non-printable charactersDaniel Eklöf2021-01-26-4/+16
| | | | | | | | Don’t allow non-printable characters in the search input string.
| * terminal: fix encoding of mouse buttons 6 and 7 in mouse eventsDaniel Eklöf2021-01-26-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These two buttons were encoded using the *exact* same numbers as button 4 and 5 (scroll wheel up/down), making it impossible to distinguish them. The relevant section from XTerm’s control sequences documentation is: Some wheel mice can send additional button events, e.g., by tilting the scroll wheel left and right. Additional buttons are encoded like the wheel mice, o by adding 64 (for buttons 6 and 7), or o by adding 128 (for buttons 8 through 11).
| * changelog: add bug ref to the ‘FreeBSD support’ entryDaniel Eklöf2021-01-23-1/+1
| |
| * changelog: freebsd supportDaniel Eklöf2021-01-23-0/+2
| |
| * ci: freebsd-x64: compile with -Wno-missing-bracesDaniel Eklöf2021-01-23-2/+4
| | | | | | | | | | | | | | | | The freebsd/latest image is still FreeBSD-12, with clang-8. It generate false positive warnings: ../../foot/search.c:357:21: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] mbstate_t ps = {0};
| * shm: don’t check for __i386__ and __x86_64__ - there are other architectures out thereDaniel Eklöf2021-01-23-11/+11
| | | | | | | | | | Instead, check for __SIZEOF_POINTER__ == 8, since what we’re really interested in is whether we have enough virtual address space or not.
| * client: explicitly use a 64-bit type for ‘total_len’Daniel Eklöf2021-01-23-1/+1
| | | | | | | | | | | | | | | | This fixes an out-of-range comparison in 32-bit builds: client.c:289:19: error: result of comparison of constant 4294967296 with expression of type 'size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (total_len >= 1llu << (8 * sizeof(uint32_t)) || ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| * completions/zsh: unbreak with BSD find(1)Jan Beich2021-01-23-2/+2
| | | | | | | | find: -printf: unknown primary or operator
| * ci: enable freebsd-x64 jobJan Beich2021-01-23-5/+6
| | | | | | | | | | - Add missing dependencies - Disable terminfo to match downstream
| * meson: optionalize terminfo dependencyJan Beich2021-01-23-10/+22
| | | | | | | | | | | | | | | | ncurses on FreeBSD still uses termcap(5) while foot works fine with xterm-256color sans status line and visible bell. Having more than one ncurses version installed may break other applications. Document -Dterminfo=false uses --term=xterm-256color by default
| * meson: depend on wayland-client when using wayland-protocolsJan Beich2021-01-23-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Base compiler on BSDs doesn't look where packages are installed to avoid tainting build environment. When system fcft is installed to the same prefix as wayland-client it passes CFLAGS that satisfy both but when using subprojects/fcft there's a build error. xdg-shell.c:33:10: fatal error: 'wayland-util.h' file not found xdg-decoration-unstable-v1.c:28:10: fatal error: 'wayland-util.h' file not found xdg-output-unstable-v1.c:28:10: fatal error: 'wayland-util.h' file not found presentation-time.c:28:10: fatal error: 'wayland-util.h' file not found primary-selection-unstable-v1.c:28:10: fatal error: 'wayland-util.h' file not found text-input-unstable-v3.c:33:10: fatal error: 'wayland-util.h' file not found In file included from ../../foot/grid.c:1: In file included from ../../foot/grid.h:5: In file included from ../../foot/terminal.h:19: ../../foot/wayland.h:8:10: fatal error: 'wayland-client.h' file not found In file included from ../../foot/selection.c:1: ../../foot/selection.h:4:10: fatal error: 'wayland-client.h' file not found