| Commit message (Collapse) | Author | Age | Lines | ||
|---|---|---|---|---|---|
| ... | |||||
| * | selection: text_from_{clipboard,primary}: add 'done' callback | Daniel Eklöf | 2019-11-05 | -34/+59 | |
| | | | | | | | | | This callback is *always* called, including when there has been an error. This is in preparation for making text_from_{clipboard,primary} asynchronous. | ||||
| * | selection: async send: handle POLLHUP | Daniel Eklöf | 2019-11-05 | -1/+4 | |
| | | |||||
| * | selection: free strdup:ed clipboard data on fdm failure | Daniel Eklöf | 2019-11-05 | -0/+4 | |
| | | |||||
| * | selection: remove debug assert | Daniel Eklöf | 2019-11-05 | -1/+0 | |
| | | |||||
| * | selection: typedef not needed here (copy-paste from fdm.h) | Daniel Eklöf | 2019-11-05 | -2/+0 | |
| | | |||||
| * | selection: we don't set user data on primary/clipboard data sources | Daniel Eklöf | 2019-11-04 | -4/+4 | |
| | | |||||
| * | input: remove unneeded(?) term_reset_view() calls | Daniel Eklöf | 2019-11-04 | -2/+2 | |
| | | | | | | | Not sure why these were added here; they don't appear to be needed (we're writing to the client - it's up to the client to echo stuff, in which case we redraw as usual). | ||||
| * | selection: try to write selection data synchronously first | Daniel Eklöf | 2019-11-04 | -35/+70 | |
| | | | | | Only if we fail to write everything do we switch to asynchronous mode. | ||||
| * | terminal: use async_write() when writing to ptmx | Daniel Eklöf | 2019-11-04 | -50/+20 | |
| | | |||||
| * | async: add async_write(), a write primitive to write to a NONBLOCK:ing FD | Daniel Eklöf | 2019-11-04 | -0/+60 | |
| | | |||||
| * | selection: send primary/clipboard data asynchronously | Daniel Eklöf | 2019-11-04 | -36/+83 | |
| | | | | | TODO: try writing synchronously first | ||||
| * | terminal: add comments describing the sync/async writing modes | Daniel Eklöf | 2019-11-04 | -1/+25 | |
| | | |||||
| * | Merge branch 'window-urgency' | Daniel Eklöf | 2019-11-04 | -0/+20 | |
| |\ | |||||
| | * | csi: comment out handling of CSI ? 1042/1043 h/l | Daniel Eklöf | 2019-11-04 | -0/+4 | |
| | | | | | | | | | | | In Wayland, we neither _have_ an urgency hint to set, nor can we raise the window(?) | ||||
| | * | csi: recognize CSI ? 1042/1043 h/l | Daniel Eklöf | 2019-11-04 | -0/+16 | |
| |/ | | | | | 1042: set 'urgency' window manager hint when receiving ctrl-g 1043: raise window when receiving ctrl-g | ||||
| * | doc: foot.5: don't upper case 'one' in the middle of a sentence | Daniel Eklöf | 2019-11-03 | -1/+1 | |
| | | |||||
| * | doc: foot.1: add description of the (mouse) wheel | Daniel Eklöf | 2019-11-03 | -0/+2 | |
| | | |||||
| * | doc: foot.1: spelling | Daniel Eklöf | 2019-11-03 | -1/+1 | |
| | | |||||
| * | wayland: verify xdg-output-manager interface version | Daniel Eklöf | 2019-11-03 | -1/+6 | |
| | | |||||
| * | wayland: verify server implements the required interface versions | Daniel Eklöf | 2019-11-03 | -18/+77 | |
| | | |||||
| * | README: remove extra period | Daniel Eklöf | 2019-11-03 | -1/+1 | |
| | | |||||
| * | man: foot.1: add reference to footclient(1) | Daniel Eklöf | 2019-11-03 | -1/+1 | |
| | | |||||
| * | man: footclient.1: initial documentation | Daniel Eklöf | 2019-11-03 | -1/+34 | |
| | | |||||
| * | man: foot.1: add a DESCRIPTION | Daniel Eklöf | 2019-11-03 | -0/+11 | |
| | | |||||
| * | man: foot.1: document -s,--server | Daniel Eklöf | 2019-11-03 | -0/+22 | |
| | | |||||
| * | main: usage for --server now hints about 'footclient' | Daniel Eklöf | 2019-11-03 | -1/+1 | |
| | | |||||
| * | slave: restore signals before calling exec() | Daniel Eklöf | 2019-11-03 | -1/+14 | |
| | | |||||
| * | main: ignore SIGHUP in master process | Daniel Eklöf | 2019-11-03 | -0/+5 | |
| | | |||||
| * | Remove unneeded include | Daniel Eklöf | 2019-11-03 | -2/+0 | |
| | | |||||
| * | slave: remove unneeded define | Daniel Eklöf | 2019-11-03 | -1/+0 | |
| | | |||||
| * | terminal: malloc_trim() is a GNU extension | Daniel Eklöf | 2019-11-03 | -0/+4 | |
| | | |||||
| * | terminal: trim memory after free:ing a terminal | Daniel Eklöf | 2019-11-03 | -0/+3 | |
| | | | | | | | | | | | | | | A terminal with lots of scrollback history will have allocated a lot of memory. Normally, free() wont return this memory to the OS, and we don't seem to trigger the automatic trim calls. This means the server would accumulate quite a lot of memory over time, as terminals come and go. Now we explicitly trim the memory every time a terminal is destroyed. | ||||
| * | README: updates | Daniel Eklöf | 2019-11-03 | -2/+17 | |
| | | | | | | | * Multiple windows _are_ supported, sort of, via --server * Add note about GNOME not having SSDs * Add mouse wheel to list of keyboard/mouse shortcuts | ||||
| * | terminal: ptmx fdm handler: tag unlikely branches | Daniel Eklöf | 2019-11-03 | -3/+3 | |
| | | |||||
| * | terminal: comments and cleanup | Daniel Eklöf | 2019-11-03 | -0/+9 | |
| | | |||||
| * | server: set CLOEXEC | NONBLOCK directly in socket() call | Daniel Eklöf | 2019-11-03 | -17/+2 | |
| | | |||||
| * | Merge branch 'async-ptmx' | Daniel Eklöf | 2019-11-03 | -88/+210 | |
| |\ | |||||
| | * | terminal: cleanup asynchronous ptmx output handling | Daniel Eklöf | 2019-11-03 | -37/+41 | |
| | | | | | | | | | | | Break out actual writing to a separate function, and call this function both from the synchronous and the asynchronous code paths. | ||||
| | * | Merge branch 'master' into async-ptmx | Daniel Eklöf | 2019-11-03 | -1/+10 | |
| | |\ | |/ |/| | |||||
| * | | slave: turn on FD_CLOEXEC after slave has been spawned | Daniel Eklöf | 2019-11-03 | -0/+9 | |
| | | | | | | | | | | | This ensures that our ptmx FD isn't carried over to other terminals spawned later. | ||||
| * | | server: FD_CLOEXEC is a file descriptor flag, not a file status flag | Daniel Eklöf | 2019-11-03 | -1/+1 | |
| | | | |||||
| | * | term: asynchronous writes to slave | Daniel Eklöf | 2019-11-03 | -21/+106 | |
| | | | | | | | | | | | | | | | | | | | | | Make ptmx non-blocking. Then, when writing data to the slave would have blocked, use the FDM to asynchronously write the remaining data. This is done by enabling EPOLLOUT on ptmx, and enqueueing all outgoing data. The FDM handler will go through the enqueued data, and once all of it has been written, we turn off EPOLLOUT again (thus switching back to synchronous writes) | ||||
| | * | fdm: invert check to get rid of one level of indentation | Daniel Eklöf | 2019-11-02 | -13/+14 | |
| | | | |||||
| | * | Rename: vt_to_slave() -> term_to_slave() | Daniel Eklöf | 2019-11-02 | -46/+46 | |
| | | | |||||
| | * | misc: fdm already logs failures | Daniel Eklöf | 2019-11-02 | -30/+8 | |
| | | | |||||
| | * | fdm: add fdm_event_add() and fdm_event_del() | Daniel Eklöf | 2019-11-02 | -1/+55 | |
| |/ | | | | | These functions allow users to modify already registered FDs, to add or remove events they are interested in. | ||||
| * | fdm: bug: 'ret' was renamed to 'r', and replaced with another 'ret' | Daniel Eklöf | 2019-11-02 | -1/+1 | |
| | | |||||
| * | fdm: rename struct fd -> struct handler | Daniel Eklöf | 2019-11-02 | -11/+11 | |
| | | |||||
| * | fdm: fdm_destroy(): assert deferred delete list is empty | Daniel Eklöf | 2019-11-02 | -0/+2 | |
| | | |||||
| * | fdm: purge deferred delete list also when handler fails | Daniel Eklöf | 2019-11-02 | -5/+8 | |
| | | |||||
| * | server: server_destroy(): unlink UNIX socket | Daniel Eklöf | 2019-11-02 | -0/+2 | |
| | | |||||
| * | server: use a non-blocking socket when trying to connect | Daniel Eklöf | 2019-11-02 | -4/+23 | |
| | | | | | | | | | | | | | | | When checking of a 'foot --server' instance is already running, we try to connect to the UNIX socket we're planning on listening on. In most cases, this will fail hard and fast. But under certain circumstances, we can get stuck in connect() waiting for a connection timeout. Since it should be possible to establish a connection immediately *if* there's someone actually listening on the socket, rely on the fact that connect() will fail with a EINPROGRESS if a connection can *not* be established immediately (and thus no one is listening on it). | ||||
| * | main: pre-allocate fonts | Daniel Eklöf | 2019-11-02 | -1/+28 | |
| | | | | | | | | | Since fonts are cached, this adds no additional memory. However, it makes the first terminal window in --server mode start much faster, since the (primary) fonts have already been loaded. Fallback fonts are still loaded on-demand. | ||||
| * | fdm: fdm_poll(): disallow nested calls | Daniel Eklöf | 2019-11-02 | -0/+6 | |
| | | |||||
| * | server: don't get stuck in read() if TERM length is 0 | Daniel Eklöf | 2019-11-02 | -2/+4 | |
| | | |||||
| * | server: don't get stuck in read() if length of argv argument is 0 | Daniel Eklöf | 2019-11-02 | -0/+3 | |
| | | |||||
| * | terminal: don't get stuck waiting for misbehaving slaves to terminate | Daniel Eklöf | 2019-11-02 | -4/+64 | |
| | | | | | | | | | | | | | | | While unusual, it *is* possible for a client *not* to terminate when we close ptmx. We need to handle this *somehow*. Since it is so unusual, we'll go with a fairly easy, but synchronous method: * Register a signal handler for SIGALRM, and setup a 2 second alarm * Wait for slave to die * If it didn't die, sent SIGTERM, then re-set the alarm for another 2 seconds. * If it still hasn't died, send SIGKILL (this time without an alarm). | ||||
| * | terminal: 'child_ret' variables isn't needed | Daniel Eklöf | 2019-11-02 | -5/+3 | |
| | | |||||
| * | timerfd: read() returns -1 with errno == EAGAIN, not 0 | Daniel Eklöf | 2019-11-02 | -20/+12 | |
| | | | | | | | When there hasn't been a timeout (or in our case, there was a timeout, but we reset the timer before we got to the read()), read() returns, not 0, but -1 with errno == EAGAIN. | ||||
| * | shm: purge buffers *before* we (maybe) return one from the cache | Daniel Eklöf | 2019-11-02 | -16/+16 | |
| | | |||||
| * | Revert "render: last_buf may point to a free:d buffer" | Daniel Eklöf | 2019-11-02 | -23/+9 | |
| | | | | | This reverts commit 4d3251a93b4ba309d573aca6ff397df44c4ff760. | ||||
| * | shm: automatic buffer purging is now delayed one cycle | Daniel Eklöf | 2019-11-02 | -5/+22 | |
| | | | | | | This ensures we don't purge a buffer that a user is holding a reference to. | ||||
| * | timerfd: use non-blocking mode, fixes dead lock | Daniel Eklöf | 2019-11-02 | -5/+25 | |
| | | | | | | | | | | | | Since we cancel the timers every now and then, there's a (small) chance that one handler cancels a timer that has triggered in the same epoll() iteration. When this happens, read() blocks. Fix by making the timer FDs non-blocking, and simply returning when we read 0 bytes. | ||||
| * | server: purge shm buffers when terminal is destroyed | Daniel Eklöf | 2019-11-01 | -0/+6 | |
| | | |||||
| * | shm: add shm_purge() | Daniel Eklöf | 2019-11-01 | -0/+19 | |
| | | | | | Destroys *all* buffers associated with the specified cookie. | ||||
| * | render: last_buf may point to a free:d buffer | Daniel Eklöf | 2019-11-01 | -9/+23 | |
| | | | | | So, store last buf's width/height separately | ||||
| * | shm: purge unused buffers | Daniel Eklöf | 2019-11-01 | -7/+28 | |
| | | | | | | | When we need to create a new buffer (because the cache doesn't have any buffers of correct size, or because they're all busy), purge buffers with a size mismatch. | ||||
| * | shm: associate a 'cookie' with each buffer | Daniel Eklöf | 2019-11-01 | -8/+21 | |
| | | | | | | | | When re-using a buffer from cache, only re-use ones with a matching cookie. This prevents contention between multiple terminal windows. | ||||
| * | shm: get_buffer(): remove 'copies' argument; it's not used | Daniel Eklöf | 2019-11-01 | -7/+4 | |
| | | |||||
| * | shm: add debug logging of how large the allocated memory buffer is | Daniel Eklöf | 2019-11-01 | -0/+3 | |
| | | |||||
| * | shm: fix name of memfd | Daniel Eklöf | 2019-11-01 | -1/+1 | |
| | | |||||
| * | client: bug: verify argv was sent correctly | Daniel Eklöf | 2019-11-01 | -1/+1 | |
| | | | | | We checked we had written 2 bytes (sizeof(len)), not <len> bytes. | ||||
| * | client: add debug logging of argc/argv | Daniel Eklöf | 2019-11-01 | -0/+4 | |
| | | |||||
| * | server: add debug logging of client argc/argv | Daniel Eklöf | 2019-11-01 | -0/+4 | |
| | | |||||
| * | Merge branch 'multi-window' | Daniel Eklöf | 2019-11-01 | -171/+923 | |
| |\ | |||||
| | * | client: register signal handler for SIGTERM too | Daniel Eklöf | 2019-11-01 | -1/+2 | |
| | | | |||||
| | * | client/server: add -t,--term to footclient | Daniel Eklöf | 2019-11-01 | -3/+40 | |
| | | | |||||
| | * | term_init(): initialize slave TERM from term_init() argument | Daniel Eklöf | 2019-11-01 | -6/+6 | |
| | | | |||||
| | * | slave: set TERM environment variable in slave process | Daniel Eklöf | 2019-11-01 | -4/+6 | |
| | | | |||||
| | * | PKGBUILD: need to execute footclient, to generate profiling data | Daniel Eklöf | 2019-11-01 | -0/+2 | |
| | | | |||||
| | * | client: add long options for --verbose and --help | Daniel Eklöf | 2019-11-01 | -1/+7 | |
| | | | |||||
| | * | wayland: wayl_win_destroy(): looks like we need another roundtrip | Daniel Eklöf | 2019-11-01 | -0/+2 | |
| | | | |||||
| | * | font: cache loaded fonts globally | Daniel Eklöf | 2019-11-01 | -0/+52 | |
| | | | | | | | | | | | | | | | | | | | Each font instance has a ref-counter. Whenever we want to instantiate a font that has already been loaded, we instead return the already-loaded instance, and bump the ref counter. When the last font instance is destroyed, it is also removed from the cache. | ||||
| | * | completions: zsh: add --server and --term to completions | Daniel Eklöf | 2019-11-01 | -4/+10 | |
| | | | |||||
| | * | client: a standalone binary that connects to a foot --server | Daniel Eklöf | 2019-11-01 | -0/+143 | |
| | | | |||||
| | * | server: implement a --server mode | Daniel Eklöf | 2019-11-01 | -2/+334 | |
| | | | | | | | | | | | | | | | | | | | | | | | In this mode, foot listens on a UNIX socket and creates terminal windows when clients connect. A connecting client sends argc/argv to the server, and the server instantiates a new terminal window. When the terminal window is closed, the exit code is sent back to the client. | ||||
| | * | main: register signal handlers for SIGINT and SIGTERM | Daniel Eklöf | 2019-11-01 | -0/+15 | |
| | | | |||||
| | * | terminal: call user-defined callback when destroying terminal | Daniel Eklöf | 2019-11-01 | -13/+38 | |
| | | | | | | | | | main uses this to get the exit code of the terminal. | ||||
| | * | term_shutdown(): cleanup | Daniel Eklöf | 2019-11-01 | -49/+35 | |
| | | | | | | | | | | | * Close FDs, then delay destruction to next epoll() call * Destroy window before destroying terminal | ||||
| | * | terminal: fdm_del() closes the FD | Daniel Eklöf | 2019-11-01 | -20/+6 | |
| | | | |||||
| | * | terminal: delayed rendering: fdm_delayed_render() may be called with is_armged==false | Daniel Eklöf | 2019-11-01 | -1/+2 | |
| | | | | | | | | | This would happen if *both* timers triggered in the same epoll() call. | ||||
| | * | terminal: no need to check for EAGAIN - we don't use non-blocking | Daniel Eklöf | 2019-11-01 | -18/+10 | |
| | | | |||||
| | * | render: limit length of title in call to xdg_toplevel_set_title() | Daniel Eklöf | 2019-11-01 | -1/+13 | |
| | | | | | | | | | | | | | Trying to pass a too long title (not sure what "too long" is though...) will trigger a call to abort() inside the wayland-client library. | ||||
| | * | wayland: wayl_destroy(): destroy any remaining terminals | Daniel Eklöf | 2019-11-01 | -0/+9 | |
| | | | |||||
| | * | Don't use non-blocking FDs | Daniel Eklöf | 2019-11-01 | -33/+6 | |
| | | | | | | | | | | | We use epoll() to determine when we can read/write FDs so there's absolutely no need for non-blocking. | ||||
| | * | wayland: wayl_win_destroy(): unmap windows before destroying | Daniel Eklöf | 2019-11-01 | -0/+23 | |
| | | | | | | | | | | | | | | | | | | | This will trigger e.d. keyboard_leave() and wl_pointer_leave() events, which ensures there aren't any references to the destroyed window from the global wayland struct. Call wl_display_roundtrip() to trigger those events *before* we destroy the window. | ||||
| | * | wayland: wayl_init(): call wl_display_roundtrip() when done | Daniel Eklöf | 2019-11-01 | -2/+3 | |
| | | | |||||
| | * | render: call wl_display_flush() after rendering | Daniel Eklöf | 2019-11-01 | -1/+2 | |
| | | | | | | | | | This allows us to remove that call from the main event loop. | ||||
| | * | wayland: fdm_del() now closes the FD | Daniel Eklöf | 2019-11-01 | -4/+3 | |
| | | | |||||
| | * | fdm: don't free FD data that may be referenced by epoll return data | Daniel Eklöf | 2019-11-01 | -9/+60 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is perfectly possible, and legal, for a FDM handler to delete another handler. The problem however is when the epoll returned array of FD events contain the removed FD handler *after* the handler that removed it. That is, if the epoll returned array is: [FD=13, FD=37] and the handler for FD=13 removes FD=37, then given the current implementation, the FD user data (our handler callback etc) will point to a free:d address. Add support for this situation by deferring FD handler removal *when called from another handler*. This is done by "locking" the FDM struct before looping the handlers for FDs with events (and unlocking afterwards). In fdm_del(), we check if the FDM has been locked, in which case the FD is marked as deleted, and put on a deferred list. But not *actually* deleted. Meanwhile, in the FDM poll function, we skip calling handlers for marked-for-deletion FDs. Then, when all FDs have been processed, we loop the deferred list and finally deletes the FDs for real. | ||||
