aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
* csi: el/ed/dch/ich/ech: reset 'print_needs_wrap' (lcf)Daniel Eklöf2019-11-17-0/+9
| | | | | This makes the result of 'wraptest', by Mattias Engdegård, match the behavior of 'DEC' (the architectural behavior of DEC terminals).
* term: cursor_{up,down}: limit cursor movements based on origin modeDaniel Eklöf2019-11-16-2/+8
|
* Merge branch 'tab-stop'Daniel Eklöf2019-11-16-67/+110
|\
| * vt: execute: \t: use tab stops from tab stop listDaniel Eklöf2019-11-16-3/+8
| | | | | | | | | | Instead of assuming hardcoded 8-width tab stops, use the tab stops from the tab stop list.
| * vt: implement ESC H - set tab stop at current columnDaniel Eklöf2019-11-16-0/+11
| |
| * tllist: update to latestDaniel Eklöf2019-11-16-27/+50
| | | | | | | | In particular, pull in tll_insert_{before,after}
| * selection: buffer may be empty if only empty cells where selectedDaniel Eklöf2019-11-16-0/+6
| |
| * csi: implement CSI 0g and CSI 3gDaniel Eklöf2019-11-16-0/+26
| | | | | | | | | | * 0g - clear tab stop at current column * 3g - clear all tab stops
| * vt: remove commented out codeDaniel Eklöf2019-11-16-37/+0
| |
| * render: configure default tab stops when resizing the terminalDaniel Eklöf2019-11-16-0/+5
| |
| * term: add tab-stop list to terminal structDaniel Eklöf2019-11-16-0/+4
|/ | | | This list is intended to store tab stop columns
* vt: DECALN: render at bottom of terminal, not in viewDaniel Eklöf2019-11-14-1/+1
|
* csi: CSI ?4h enables smooth scrolling, ?4l enables jump scrollingDaniel Eklöf2019-11-05-2/+7
|
* server: disable debug outputDaniel Eklöf2019-11-05-1/+1
|
* vt: implement VT - Vertical TabDaniel Eklöf2019-11-05-0/+5
| | | | Despite its name, it always moves down exactly one line.
* vt: always use hex (not octal)Daniel Eklöf2019-11-05-2/+2
|
* vt: log hex version of printed character tooDaniel Eklöf2019-11-05-1/+1
|
* vt: always disable state_names[] arrayDaniel Eklöf2019-11-05-1/+1
| | | | It isn't used anywhere, even with LOG_ENABLE_DBG
* csi: implement DECOM - switch cursor origin between absolute and relativeDaniel Eklöf2019-11-05-14/+64
| | | | | | | | | | | The default is absolute mode, where 0,0 is the upper left corner of the screen. In relative mode, the origin is relative the top scroll margin. Internally, we always track the current cursor position in absolute mode. Every time we the client *sets* or *queries* the cursor position in relative mode, we translate it to absolute.
* csi: DECCOLM erases screenDaniel Eklöf2019-11-05-0/+15
|
* vt: esc dispatch: implement DECALNDaniel Eklöf2019-11-05-65/+118
| | | | | | | In esc dispatch: * Switch on private first, then final * Recognize ESC #8 (DECALN), and implement it
* csi: CSI ?3h enables 132 column mode, CSI ?3l 80 column modeDaniel Eklöf2019-11-05-2/+6
|
* csi: implement force cursor positionDaniel Eklöf2019-11-05-0/+1
|
* scan-build: fix a couple of minor warnings from a scan-build runDaniel Eklöf2019-11-05-5/+7
|
* server/client: harden reading of initialization data, and make asyncDaniel Eklöf2019-11-05-33/+111
| | | | | | | | | | | | | | | | | | | | * Client terminal initialization data is now received asynchronously. To facilitate this, a couple of minor changes to the protocol was made: - The client now starts with sending a 4-byte unsigned integer with the *total* size of the initialization data (*not* including the size field itself. - Strings (TERM variable + argv) are now sent NULL-terminated * The server allocates a single buffer, and fills it asynchronously. When full (as indicated by the initial 'total size' integer), we parse it (taking care not to read outside boundaries etc, and verifies the lengths (of the TERM variable and argv array) indicated by the client matches the actual lengths of the strings received. * The server now ignores 'unexpected' data received from the client, after the terminal has been instantiated.
* server: workaround evil clientsDaniel Eklöf2019-11-05-0/+6
| | | | | If the clients attempt to send more data after we've instantiated the terminal, just consume the data but ignore it.
* server: don't cache argc/argv in client contextDaniel Eklöf2019-11-05-17/+18
|
* main: destroy cached SHM buffers *after* terminals have been destroyedDaniel Eklöf2019-11-05-2/+2
|
* terminal: ptmx: ignore *both* EPOLLIN and EPOLLOUT on EPOLLHUPDaniel Eklöf2019-11-05-5/+11
|
* selection: document the asynchronous behavior of text_from_{primary,clipboard}Daniel Eklöf2019-11-05-1/+17
|
* selection: make text_from_{clipboard,primary} asyncDaniel Eklöf2019-11-05-61/+84
|
* selection: initialize 'ctx' before jumping into its scopeDaniel Eklöf2019-11-05-2/+2
|
* selection: text_from_{clipboard,primary}: add 'done' callbackDaniel Eklöf2019-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 POLLHUPDaniel Eklöf2019-11-05-1/+4
|
* selection: free strdup:ed clipboard data on fdm failureDaniel Eklöf2019-11-05-0/+4
|
* selection: remove debug assertDaniel Eklöf2019-11-05-1/+0
|
* selection: typedef not needed here (copy-paste from fdm.h)Daniel Eklöf2019-11-05-2/+0
|
* selection: we don't set user data on primary/clipboard data sourcesDaniel Eklöf2019-11-04-4/+4
|
* input: remove unneeded(?) term_reset_view() callsDaniel Eklöf2019-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 firstDaniel Eklöf2019-11-04-35/+70
| | | | Only if we fail to write everything do we switch to asynchronous mode.
* terminal: use async_write() when writing to ptmxDaniel Eklöf2019-11-04-50/+20
|
* async: add async_write(), a write primitive to write to a NONBLOCK:ing FDDaniel Eklöf2019-11-04-0/+60
|
* selection: send primary/clipboard data asynchronouslyDaniel Eklöf2019-11-04-36/+83
| | | | TODO: try writing synchronously first
* terminal: add comments describing the sync/async writing modesDaniel Eklöf2019-11-04-1/+25
|
* Merge branch 'window-urgency'Daniel Eklöf2019-11-04-0/+20
|\
| * csi: comment out handling of CSI ? 1042/1043 h/lDaniel Eklöf2019-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/lDaniel Eklöf2019-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 sentenceDaniel Eklöf2019-11-03-1/+1
|
* doc: foot.1: add description of the (mouse) wheelDaniel Eklöf2019-11-03-0/+2
|
* doc: foot.1: spellingDaniel Eklöf2019-11-03-1/+1
|
* wayland: verify xdg-output-manager interface versionDaniel Eklöf2019-11-03-1/+6
|
* wayland: verify server implements the required interface versionsDaniel Eklöf2019-11-03-18/+77
|
* README: remove extra periodDaniel Eklöf2019-11-03-1/+1
|
* man: foot.1: add reference to footclient(1)Daniel Eklöf2019-11-03-1/+1
|
* man: footclient.1: initial documentationDaniel Eklöf2019-11-03-1/+34
|
* man: foot.1: add a DESCRIPTIONDaniel Eklöf2019-11-03-0/+11
|
* man: foot.1: document -s,--serverDaniel Eklöf2019-11-03-0/+22
|
* main: usage for --server now hints about 'footclient'Daniel Eklöf2019-11-03-1/+1
|
* slave: restore signals before calling exec()Daniel Eklöf2019-11-03-1/+14
|
* main: ignore SIGHUP in master processDaniel Eklöf2019-11-03-0/+5
|
* Remove unneeded includeDaniel Eklöf2019-11-03-2/+0
|
* slave: remove unneeded defineDaniel Eklöf2019-11-03-1/+0
|
* terminal: malloc_trim() is a GNU extensionDaniel Eklöf2019-11-03-0/+4
|
* terminal: trim memory after free:ing a terminalDaniel Eklöf2019-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: updatesDaniel Eklöf2019-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 branchesDaniel Eklöf2019-11-03-3/+3
|
* terminal: comments and cleanupDaniel Eklöf2019-11-03-0/+9
|
* server: set CLOEXEC | NONBLOCK directly in socket() callDaniel Eklöf2019-11-03-17/+2
|
* Merge branch 'async-ptmx'Daniel Eklöf2019-11-03-88/+210
|\
| * terminal: cleanup asynchronous ptmx output handlingDaniel Eklöf2019-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-ptmxDaniel Eklöf2019-11-03-1/+10
| |\ | |/ |/|
* | slave: turn on FD_CLOEXEC after slave has been spawnedDaniel Eklöf2019-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 flagDaniel Eklöf2019-11-03-1/+1
| |
| * term: asynchronous writes to slaveDaniel Eklöf2019-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 indentationDaniel Eklöf2019-11-02-13/+14
| |
| * Rename: vt_to_slave() -> term_to_slave()Daniel Eklöf2019-11-02-46/+46
| |
| * misc: fdm already logs failuresDaniel Eklöf2019-11-02-30/+8
| |
| * fdm: add fdm_event_add() and fdm_event_del()Daniel Eklöf2019-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öf2019-11-02-1/+1
|
* fdm: rename struct fd -> struct handlerDaniel Eklöf2019-11-02-11/+11
|
* fdm: fdm_destroy(): assert deferred delete list is emptyDaniel Eklöf2019-11-02-0/+2
|
* fdm: purge deferred delete list also when handler failsDaniel Eklöf2019-11-02-5/+8
|
* server: server_destroy(): unlink UNIX socketDaniel Eklöf2019-11-02-0/+2
|
* server: use a non-blocking socket when trying to connectDaniel Eklöf2019-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 fontsDaniel Eklöf2019-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 callsDaniel Eklöf2019-11-02-0/+6
|
* server: don't get stuck in read() if TERM length is 0Daniel Eklöf2019-11-02-2/+4
|
* server: don't get stuck in read() if length of argv argument is 0Daniel Eklöf2019-11-02-0/+3
|
* terminal: don't get stuck waiting for misbehaving slaves to terminateDaniel Eklöf2019-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 neededDaniel Eklöf2019-11-02-5/+3
|
* timerfd: read() returns -1 with errno == EAGAIN, not 0Daniel Eklöf2019-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 cacheDaniel Eklöf2019-11-02-16/+16
|
* Revert "render: last_buf may point to a free:d buffer"Daniel Eklöf2019-11-02-23/+9
| | | | This reverts commit 4d3251a93b4ba309d573aca6ff397df44c4ff760.
* shm: automatic buffer purging is now delayed one cycleDaniel Eklöf2019-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 lockDaniel Eklöf2019-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 destroyedDaniel Eklöf2019-11-01-0/+6
|
* shm: add shm_purge()Daniel Eklöf2019-11-01-0/+19
| | | | Destroys *all* buffers associated with the specified cookie.
* render: last_buf may point to a free:d bufferDaniel Eklöf2019-11-01-9/+23
| | | | So, store last buf's width/height separately
* shm: purge unused buffersDaniel Eklöf2019-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 bufferDaniel Eklöf2019-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.