summaryrefslogtreecommitdiff
path: root/src/client_manager.cc
AgeCommit message (Collapse)Author
2025-07-08Replace std::unique_ptr with a custom implementationMaxime Coste
<memory> is a costly header we can avoid by just implementing UniquePtr ourselves, which is a pretty straightforward in modern C++, this saves around 10% of the compilation time here.
2025-06-29Fix compilation with compilers not supporting auto(x)Maxime Coste
2025-06-27Prevent changing Client's buffer while lockedMaxime Coste
If the current buffer is locked, it means we are in the middle of creating the client or already changing the buffer, error out in this case instead of getting into an inconsistent state. Fixes #5338
2025-06-03Prevent deletion of buffers while creating new windowsMaxime Coste
`kak -n -E 'hook global WinCreate .* %{ delete-buffer }'` was crashing because we would delete the buffer during window construction, which would not be able to delete the window as it was not fully constructed and registered yet. This led to a window referencing a deleted buffer. Fixing this by deleting the window later on failed because we can enter an infinite loop where we constantly create a new *scratch* buffer, then a window to display it, which deletes that buffer. Make it an error to try to delete a buffer while a new window is being setup by adding a Locked flag to buffers and checking that in BufferManager::delete_buffer Fixes #5311
2024-08-16include headers cleanupAdrià Arrufat
2024-06-05Echo an information message about *scratch* buffer and leave it emptyMaxime Coste
Having to manually clear the scratch was never really nice and hopefully this will be less annoying and as helpful to newcomers.
2023-08-27Remove Window::force_redraw()Maxime Coste
This was mostly redundant with Client::force_redraw.
2023-01-08Fix regression when file on command line cannot be openedJohannes Altmanninger
Commit 933e4a599 (Load buffer in command line order, 2022-12-06) introduced a regression: the command $ kak /boot/grub/grub.cfg Fatal error: no such buffer '/boot/grub/grub.cfg' quits with no indication of the underlying error. Prior to 933e4a599, it would open the *scratch* buffer instead, and show an error in the status line, pointing to the debug buffer, which would contain: error while opening file '/boot/grub/grub.cfg': /boot/grub/grub.cfg: Permission denied Let's fix this scenario by matching the old behavior.
2022-12-06Load buffer in command line orderMaxime Coste
Pass the first buffer on the the command line explicitely to client creation. This ensure the buffer list matches the command line, which makes buffer-next/buffer-previous a bit more useful. Fixes #2705
2021-08-17Move control character escaping responsibility to the terminal UIMaxime Coste
Fix atom text at display time, allow tabs/eol/etc... in display atoms and escape them just-in-time Fixes #4293
2021-03-11Always redraw after getting some user inputMaxime Coste
2020-05-29Add a range based remove_if overloadMaxime Coste
2019-07-22Ensure current context switches away from buffer on delete-bufferMaxime Coste
Fixes #3025
2019-06-18Move dropped free windoes to the window trashMaxime Coste
2019-06-16Do not add window pointing to deleted buffers in the free window listMaxime Coste
Fixes #2975
2019-04-13Run ClientClose hook before exiting the client itselfMaxime Coste
Closes #2849
2019-04-12Prevent conversion to client on suspend from disconnecting other clientsMaxime Coste
clear the client manager in the to be converted process without sending exit messages as the forked server will still be there. Fixes #2847
2019-04-08Refactor ClientManager::clearMaxime Coste
2019-04-08Add a ClientCreate and ClientClose hookMaxime Coste
As discussed in #2830. Closes #2500.
2019-04-04Run WinClose hook when clearing all free windowsMaxime Coste
Fixes #2830
2019-04-04Fix detection of client ungraceful disconnectionMaxime Coste
2019-02-17Fix uses of std::remove_ifMaxime Coste
std::remove_if is not std::partition, it makes no guarantees on the state of the objects past the new end (they usually are in a moved-from state).
2019-02-17Run WinClose hook before putting the window into trashMaxime Coste
2018-10-23Refactor Hook management to have a well defined list of hooksMaxime Coste
Hooks are now an enum class instead of passing strings around.
2018-04-23Change client default name: "unnamed0" → "client0"Delapouite
2018-04-07Make FaceRegistry scopedMaxime Coste
set-face now takes a scope argument, and faces can be overridden on a buffer or window basis. colorscheme apply on global scope, which should be good enough for now. Fixes #1411
2018-04-06Make error messages more consistentDelapouite
2018-03-25Cleanup client name validation codeMaxime Coste
2018-03-25Remove contains_that and use any_of to be closer to the c++ stdlibMaxime Coste
2018-03-25Unify code that validates identifiers in KakouneMaxime Coste
Session/Client/User modes names are now requiered to be "identifiers" they must be in [a-zA-Z0-9_-]. Option names are the same except they do not allow '-' as they need to be made available through the env vars and '-' is not supported there. Fixes #1946
2018-03-23Restore client name after converting to clientMaxime Coste
When Kakoune forked the sever to background, the newly converted to client process (the original client/server process) was not preserving its previous client name.
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-08-29Rename containers.hh to ranges.hh (and Container to Range)Maxime Coste
2017-08-29avoid literal eol in status lines, replace them with another symbolMaxime Coste
2017-08-28Expose client pid as $kak_client_pidMaxime Coste
As requested in #1414
2017-08-23Support specifying an exit status on `quit` commandsMaxime Coste
The current client exit status can be specified as an optional parameter, is nothing is given the exit status will be 0. Fixes #1230
2017-07-19Migrate code to c++14Maxime Coste
2017-05-27Small code tweakMaxime Coste
2017-01-29Remove unused WindowAndSelections timestamp fieldMaxime Coste
The SelectionList already has a timestamp.
2017-01-21Support the +line syntax for clients as well.Maxime Coste
Fix a crash on daemon quit as well.
2017-01-19Only touch new clients selections when target coord are explicitMaxime Coste
Do not implicitely change new clients selections to target coordinates when the user did not specify them, so that we can re-use the selections from the found free window, which is the generally desired behaviour.
2016-12-01Fix crash when quitting the first client while another client is connectedMaxime Coste
2016-12-01Rework handling of initial coordinates so that init commands can change themMaxime Coste
Fixes #944
2016-11-30Ensure all available input is handled before going back to main loopMaxime Coste
We were not handling keys that could have been generated while handling other keys (like during a shell evaluation).
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-05Support deleting a buffer even if another client is in insert mode on itMaxime Coste
2016-10-13Always allow to delete a buffer, just recreate a scratch buffer if neededMaxime Coste
Fixes #850
2016-10-11Only create a default *scratch* when we dont have any non debug buffersMaxime Coste
Fixes #852 Closes #856
2016-09-04Rework client quitting and handling of remote errorsMaxime Coste
Client quitting no longer immediately unwinds, client is just pushed for deletion until we get back to the main loop, similarly to what happens for buffer and window deletion.
2016-05-14Delay window deletion until we get back to main loopMaxime Coste
Avoid WinResize hooks while redrawing, ensure window resize only take place while handling user input. Fixes #672