summaryrefslogtreecommitdiff
path: root/src/event_manager.hh
AgeCommit message (Collapse)Author
2024-11-22Take a timeout argument in EventManager::handle_next_eventsMaxime Coste
When provided, this gives the maximal time to wait before exiting handle_next_events. If not given handle_next_events will block, this provides a more flexible approach than the previous "block" boolean. Use this to wait for a millisecond between each try to open a fifo for writing. Fixes the 100% cpu usage discussed in github on commit e74a3ac6a3bad1b74af71aa0bfdacb41ffcb7355
2023-05-21Add <c-g> to cancel current operationMaxime Coste
The current implementation only does this during regex operations, but should be extensible to other operations that might take a long time by regularly calling EventManager::handle_urgent_events().
2021-07-07Add support for $kak_command_fifo and $kak_response_fifoMaxime Coste
Those fifos are accessible during %sh{...} blocks, the command fifo executes commands written to it once the write end side is closed (multiple open/write/close sequences are supported), the response fifo is a simple helper fifo available to write response back to the shell process An example use of this feature is to request some list options content from without being limited by the environment size: ``` %sh{ echo "echo -to-file $kak_response_fifo -quoting shell -- %opt{some_list}" > $kak_command_fifo eval "set -- $(cat $kak_response_fifo)" } ```
2021-03-11Do not select on non-urgent fd when handling only urgent eventsMaxime Coste
This avoids 100% CPU usage when we have pending fifo input while running a shell process, as we will not end-up busy looping in pselect but not reading the available data due to being only processing urgent events.
2020-12-20Add Timer::disable() to be more explicit than set_next_date(TimePoint::max())Maxime Coste
2018-06-03EventManager: Never block if a forced file descriptor is presentMaxime Coste
2018-05-17Handle all pending events before redrawingMaxime Coste
If new events happen while handling events, take care of those new events as well before redrawing.
2018-01-21Do not block when waiting for next event if we have pending inputMaxime Coste
Handle next event should never block if we have already accumulated input that we want to process. As we can accumulate new input in lots of places (everytime we run a shell process for example, we might end up reading input keys. That can be triggered during the mode line generation which takes place during display of the window) Fixes #1804
2017-07-07Formatting fixesMaxime Coste
2017-03-15Migrate WithBitOps template specialization to with_bit_ops functionMaxime Coste
This way we dont depend on knowing the base template to enable bit ops on an enum type.
2017-01-08Apply clang-tidy modernize to the codebaseMaxime Coste
2016-12-01Make FDWatcher support Read, Write and Except events, instead of just ReadMaxime Coste
2016-11-29Simplify greatly UI input handlingMaxime Coste
This round trip through an input callback expected to call is_key_available and get_key was overcomplicated, just send the keys as they arrive, the client is already buffering due to urgent event mode.
2016-11-28Add more memory domains to certain dataMaxime Coste
2016-07-24Introduce chrono.hhMaxime Coste
2016-01-10Rename set_signal_wrapper to set_signal_handler and tweak SignalHandler defMaxime Coste
2015-12-23Add a signal function using sigactionDaniel Robertson
Use a wrapper for sigaction in place of signal to ensure that the SA_RESTART flag is set for all signals used. Signed-off-by: Daniel Robertson <danlrobertson89@gmail.com>
2015-10-02Refactor ShellManager process spawningMaxime Coste
2015-06-09Fix race condition ShellManager::eval with SIGCHLDMaxime Coste
2015-01-12replace all std::vector with VectorMaxime Coste
2014-12-23Remove trailing blank linesMaxime Coste
2014-12-10Fix OSX compilationMaxime Coste
2014-12-09Get rid of uses of unordered_set, vector is just simpler and faster...Maxime Coste
2014-12-03Use a select based event handling and fix deadlockMaxime Coste
2014-11-29Rework client pending key handling, fix insert/normal timersMaxime Coste
2014-11-25Separate events between normal and urgent onesMaxime Coste
Run urgent ones while executing %sh blocks. Fixes #236
2014-03-25FDWatchers are non copiable and non movableMaxime Coste
2013-01-31Remove Set and use unordered_setMaxime Coste
2013-01-14EventManager: add support for timersMaxime Coste
2013-01-11Add and use a Set template class for recuring small setsMaxime Coste
2013-01-10Refactor EventManagerMaxime Coste
Watching a file descriptor is now done using a FDWatcher object
2012-12-03EventManager: fix forced event processingMaxime Coste
previous implementation could drop some forced events.
2012-11-27EventManager: refactor (again)Maxime Coste
2012-11-26EventManager: avoid erasing an event handler while it may be in useMaxime Coste
2012-11-06EventManager: store event handlers in an unordered_map instead of a vectorMaxime Coste
If an event handler add or removes an event from the manager, it may then be moved in the vector, and if after that it access any of it's members (through this), it results in an invalid memory access.
2012-10-27EventManager: add force_signal method to force event executionMaxime Coste
2012-08-28add a poll based EventManager and use it for ncurse client updateMaxime Coste