Commit graph

2433 commits

Author SHA1 Message Date
Daniel Eklöf
a371ea0f02
input: ignore ISO Level 3 Shift (AltGr) when hiding the mouse cursor 2020-08-04 07:38:21 +02:00
Daniel Eklöf
d929862245
config: move cursor.hide-when-typing to mouse.hide-when-typing 2020-08-04 07:33:15 +02:00
Daniel Eklöf
8f04e898af
footrc: add new option 'scrollback.multiplier' 2020-08-03 20:12:31 +02:00
Daniel Eklöf
61bd21c6f3
Merge branch 'scrollback-multiplier' into master 2020-08-03 20:11:58 +02:00
Daniel Eklöf
36468b0406
config: add scrollback.multiplier option
This option is used to multiply the mouse scroll amount for mouse and
trackpad based scrollback scrolling.

Closes #54.
2020-08-03 20:08:39 +02:00
Daniel Eklöf
93b03c91ed
input: hide-when-typing: ignore modifiers 2020-08-03 18:19:43 +02:00
Daniel Eklöf
2ee9830e2a
changelog: add craigbarnes to 'contributors' for the upcoming release 2020-08-03 08:17:26 +02:00
Daniel Eklöf
6e826d0e0a
Merge branch 'footclient-man-synopsis' into master 2020-08-03 07:54:37 +02:00
Daniel Eklöf
2f679694a5
Merge branch 'e-escape' into master 2020-08-03 07:52:52 +02:00
Craig Barnes
657c98d520 doc: fix "SYNOPSIS" section in footclient(1) man page 2020-08-03 02:53:25 +01:00
Craig Barnes
11a1d99da7 Replace non-portable "\e" escape in string literals with "\033" 2020-08-02 23:54:04 +01:00
Daniel Eklöf
91da76656c
config: clean up
Better parsing means we catch syntax errors earlier, meaning we can
remove some of the checks.
2020-08-02 20:01:07 +02:00
Daniel Eklöf
73b33afff2
Merge branch 'socket-path-uses-wayland-display-instead-of-xdg-session-id' into master 2020-08-02 19:28:44 +02:00
Daniel Eklöf
5e26d3ef47
server/client: use $WAYLAND_DISPLAY instead of $XDG_SESSION_ID in default socket path
Foot is a Wayland client and cannot be run outside of a Wayland
session. As such, it makes more sense to use $WAYLAND_SESSION instead
of $XDG_SESSION_ID in the default socket path since this makes it
clearer which Wayland session we belong to.

Closes #55.
2020-08-02 13:10:31 +02:00
Daniel Eklöf
387e8de751
main: update --help with correct default path for -s,--server
I missed this in f3c301ee8b when fixing
2020-08-02 12:41:48 +02:00
Daniel Eklöf
f3c301ee8b
doc: foot.1: fix default path in -s,--server
The documentation incorrectly stated that the default path is
$XDG_RUNTIME_DIR/foot.sock.

The correct default path is

* $XDG_RUNTIME_DIR/foot-$XDG_SESSION_ID.sock
* $XDG_RUNTIME_DIR/foot-no-session.sock
* /tmp/foot.sock

Depending on whether XDG_RUNTIME_DIR and XDG_SESSION_ID has been set
or not.

This also removes the '<>' from the default when XDG_SESSION_ID is not
set.

Closes #53.
2020-08-02 12:32:10 +02:00
Daniel Eklöf
a026938547
input: don't hide cursor if key is 'shift'
Since shift is used to enable selecting text in mouse-grabbing
applications, hiding the cursor in this case is counter productive.
2020-08-01 15:39:25 +02:00
Daniel Eklöf
bae3244ec6
Revert "slave: use an event FD to communicate errors after fork before exec"
This reverts commit 027a8de6f5.

I was a bit quick on this one, and only tested error cases. Turns out,
this causes foot to hang in a blocking read(3) on the event FD.

This is because while the FD has FD_CLOEXEC, that flag is per file
descriptor. I.e. the forked copy of the event fd is closed when we
exec(), but since this isn't a pipe, nothing is signaled to the parent
process, which thus remains blocking in read(3) since its copy of the
event fd hasn't been closed.

We _could_ write a dummy value on the event fd just before exec(), but
then we wouldn't be able to catch errors from exec() self - only
errors *before* exec().
2020-08-01 09:41:31 +02:00
Daniel Eklöf
027a8de6f5
slave: use an event FD to communicate errors after fork before exec
Replace the pipe we used to communicate errors after fork(), but
before exec() to the parent process with an event FD.

The overhead in the kernel is much lower to setup an event fd,
compared to a pipe.
2020-08-01 09:33:43 +02:00
Daniel Eklöf
c8e78674ed
slave: emit user-notifications before dup:ing stdin/stdout/stderr
Since we need to restore the status flags anyway, there's nothing to
gain from emitting the user notifications after dup:ing the pts file
descriptor.

On the other hand, emitting user notifications *before* dup:ing means
we can still print error messages for e.g. write(3) errors.
2020-08-01 09:00:18 +02:00
Daniel Eklöf
7e93405b1a
slave: user-notifications: skip the O_NONBLOCK dance when there aren't any notifications 2020-07-31 19:52:50 +02:00
Daniel Eklöf
1da8142f32
slave: restore pts file status flags after emitting user-notifications
We (need to) set O_NONBLOCK on the pts file description before
emitting the user-notifications, to ensure we don't block in write(3).

However, since file status flags are per *file*, not per
file *descriptor*, this ends up setting O_NONBLOCK on the dup:ed
stdin/stdout/stderr file descriptors too.

Not all clients want this, or can handle this.

Thus we need to restore the original flags before exec:ing the client.

This fixes "makepkg" build failures.
2020-07-31 18:13:00 +02:00
Daniel Eklöf
a7d21c5c7f
slave: user-notifications: don't block in write(3)
The main process is blocking and waiting for us to close the error
pipe (in exec(3), via O_CLOEXEC).

Thus, pts data will *not* be processed until we've exec:d the shell.

Because of this we must not write too much and block in write(3). Do
this by setting O_NONBLOCK on the pts fd (*after* dup:ing it to
stdin/stderr/sdout) and watch for EAGAIN EWOULDBLOCK.
2020-07-31 17:15:51 +02:00
Daniel Eklöf
b661513245
slave: user-notifications: emit errors first, then warnings and last deprecations 2020-07-31 17:10:39 +02:00
Daniel Eklöf
9b0376efc3
config: pipe-*: fix length calculation of the pipe command substring 2020-07-31 17:10:12 +02:00
Daniel Eklöf
d4ee9be4d7
config: add 'hide-when-typing'
When enabled, the mouse cursor is hidden when the user types in the
terminal. It is un-hidden when the user moves the mouse, or when the
window loses keyboard focus.
2020-07-31 17:09:06 +02:00
Daniel Eklöf
b00dfcf7b6
config: configuration errors are no longer fatal
Instead of refusing to start foot on configuration errors, we start
and print a user-notification.
2020-07-31 17:07:14 +02:00
Daniel Eklöf
639a61abd8
config: add 'pipe-selected' key binding
This works just like pipe-visible and pipe-scrollback, but pipes the
user-selected text, if any, to the external tool.

Closes #51
2020-07-31 17:04:30 +02:00
Daniel Eklöf
33e25e7f93
install: tllist is a *build* dependency, not a *runtime* dependency 2020-07-31 16:59:23 +02:00
Daniel Eklöf
4f9da982f0
doc+readme: make it clear(er) that RMB can be hold-and-dragged 2020-07-31 06:07:42 +02:00
Daniel Eklöf
f6533a71e4
user-notification: 'productify' the user-warning system
* Rename user_warning to user_notification
* Add warning and error types (in addition to the existing deprecated)
* Simplify logic when emitting a user notification after forking; we
  don't need to copy the notification data since we're in a new
  process and have total control over that memory.
2020-07-30 18:58:54 +02:00
Daniel Eklöf
79c17f44d9
readme: remove 'explanation' of server/daemon mode
It is described in a separate section anyway.
2020-07-30 18:54:42 +02:00
Daniel Eklöf
7767041c2c
config: tokenize key bindings' pipe command when loading the configuration
This allows us to detect syntax errors early on, and is also more
efficient since we don't have to re-tokenize the command line every
time the binding is executed.
2020-07-30 18:53:51 +02:00
Daniel Eklöf
6a186cb356
changelog: use <section>.<option> syntax 2020-07-30 18:50:01 +02:00
Daniel Eklöf
113759b0a9
slave: don't ignore write(3) errors 2020-07-29 19:46:20 +02:00
Daniel Eklöf
aed5b9e539
config: emit a user-warning for deprecated option 'scrollback' 2020-07-29 19:43:11 +02:00
Daniel Eklöf
b3d0215c38
term: add capability to print warnings *inside* the terminal
This is intended to be used to print e.g. deprecation warnings inside
the terminal, *before* the shell is started.
2020-07-29 19:42:12 +02:00
Daniel Eklöf
906c8f4d16
changelog: update scrollback indicator entry to reflect moved options 2020-07-29 17:50:19 +02:00
Daniel Eklöf
86e7cb04c4
main: add --check-config command line option 2020-07-29 17:48:22 +02:00
Daniel Eklöf
d11d374252
config: add scrollback section
* Move 'scrollback' to 'scrollback.lines'
* Move (the new) 'scrollback-indicator-*' options to
  'scrollback.indicator-*'

Log a deprecation warning when the old 'scrollback' option is used,
but don't remove it, yet.
2020-07-29 17:41:24 +02:00
Daniel Eklöf
25e745cd8a
doc: footrc.5: add 'uniq | tac' to the pipe-visible example 2020-07-29 17:32:55 +02:00
Daniel Eklöf
919f31ffcb
search/config: configurable key bindings for (scrollback) search mode 2020-07-29 17:27:01 +02:00
Daniel Eklöf
c1653c7237
render: make compiler happy; make sure 'cell_count' has been initialized
Compiler, in release builds, complains about 'cell_count' "may be used
uninitialized". This isn't true, as it is initialized in every
possible switch case below.

But, make the compiler happy and zero-initialize it before the switch
statement.
2020-07-29 07:25:56 +02:00
Daniel Eklöf
d361951dd5
changelog: scrollback indicator is a *new* feataure 2020-07-29 07:08:14 +02:00
Daniel Eklöf
63a5343dd4
Merge branch 'releases/1.4' into master 2020-07-29 07:07:46 +02:00
Daniel Eklöf
6b22758f35
meson/pkgbuild: update version to 1.4.4 2020-07-29 07:02:43 +02:00
Daniel Eklöf
a4d2a2bf28
changelog: add extra newline between index and first release 2020-07-29 07:01:44 +02:00
Daniel Eklöf
f8d9bf18e5
config: handle trailing comments and empty values 2020-07-29 07:01:10 +02:00
Daniel Eklöf
7eee2d715d
changelog: improved font size consistency across monitors with different DPI 2020-07-29 06:59:06 +02:00
Daniel Eklöf
fb57e56308
term: use the monitors diagonal DPI value, instead of it's vertical PPI value 2020-07-29 06:58:29 +02:00