Commit Graph

150 Commits

Author SHA1 Message Date
Frank LENORMAND
df31b88187 Fix "unused result" warnings for several system calls. 2015-12-10 11:00:10 +03:00
Maxime Coste
6925ff33b1 Send client dimensions on connection, avoid a race condition.
Fixes #429
2015-11-18 13:43:43 +00:00
Maxime Coste
bd01171861 Auto fork server when suspending the local client
That way, other clients can still be serviced by the server.
2015-10-08 20:05:47 +01:00
Maxime Coste
7776c38755 Detect ungraceful exits, and backup modified buffers in these cases 2015-10-08 13:43:39 +01:00
Maxime Coste
c54e6738b9 Use DisplayLine for menu choices 2015-10-05 01:25:23 +01:00
Maxime Coste
d2c4d22d1f Keep it simple, remove all that sorted id map thing 2015-09-18 13:52:32 +01:00
Maxime Coste
bab95491c8 Keep sorted state when transmitting id maps 2015-09-16 22:29:19 +01:00
Maxime Coste
693d9a4861 Store key hash in IdMap 2015-09-16 20:02:12 +01:00
Maxime Coste
73c0fa175e Use IdMap instead of UnorderedMap for ui options and env vars 2015-09-16 19:04:19 +01:00
Maxime Coste
85918d9f15 use getpwuid(geteuid())->pw_name rather than getlogin()
getlogin() can fail when stdin is not a tty on certain configuration
as it needs to find a controling terminal.
2015-09-15 13:32:26 +01:00
Maxime Coste
ededc84c8c Remove some useless code in remote.cc 2015-09-03 23:17:57 +01:00
Maxime Coste
0755366cb1 Rework resize handling
Fixes #383
2015-08-23 15:18:18 +01:00
Maxime Coste
71e362e2f9 Move session socket to /tmp/kakoune/<user name>/<session> 2015-08-23 14:13:46 +01:00
Maxime Coste
504862fce7 Avoid double session closing 2015-08-22 11:27:48 +01:00
Maxime Coste
47ab4038ec Format session socket name in place into the sockaddr_un 2015-08-22 11:27:04 +01:00
Maxime Coste
bf46870ff2 Move status/mode line drawing as a separate ui method 2015-06-17 21:28:02 +01:00
Maxime Coste
e6f0e8ef75 Move write_debug to buffer utils as write_to_debug_buffer 2015-06-06 11:54:48 +01:00
Maxime Coste
7cddaacc5d Fix support for default face on remote clients 2015-06-04 18:51:00 +01:00
Maxime Coste
8f6fc6a0f3 Port even more code to use format function 2015-06-01 21:15:59 +01:00
Maxime Coste
f19bb4fe6d Port more code to use the format function instead of adhoc string concat 2015-06-01 19:06:35 +01:00
Maxime Coste
bbefde9379 Move Colors enum class as NamedColor enum inside Color struct 2015-04-25 10:47:39 +01:00
Maxime Coste
ddd70fd09a Make empty context construction more explicit 2015-04-19 18:47:52 +01:00
Maxime Coste
1cec8df45e ArrayView content is not const anymore
As in upcoming std c++ array_view, ArrayView<T> points to mutable
data, use ArrayView<const T> or alias ConstArrayView<T> for const
data.
2015-03-09 13:54:09 +00:00
Maxime Coste
2a878d51fd Even more memory tracking 2015-01-14 19:16:32 +00:00
Maxime Coste
da562e03a0 replace all std::vector with Vector 2015-01-12 13:58:41 +00:00
Maxime Coste
295a97f2a6 Rename memoryview to ArrayView 2015-01-06 13:43:37 +00:00
Maxime Coste
ebecd60eb8 Rework hashing, use a more extensible framework similar to n3876 proposal
std::hash specialization is a pain to work with, stop using that, and
just specialize a 'size_t hash_value(const T&)' free function.
2014-12-16 18:57:19 +00:00
Maxime Coste
0517a19e6d Use a select based event handling and fix deadlock 2014-12-03 13:56:02 +00:00
Maxime Coste
49931fbf05 Separate events between normal and urgent ones
Run urgent ones while executing %sh blocks.

Fixes #236
2014-11-25 13:52:06 +00:00
Maxime Coste
b2407d9dfa Add ui_options option for UserInterface configuration
ui_options is a std::unordered_map<String, String> that gets
forwarded to the user interface. Add support ncurses_status_on_top.
2014-11-10 23:29:16 +00:00
Maxime Coste
e1fc2677e3 Add a MenuDoc style for info box, that will place it next to the menu 2014-11-08 18:01:55 +00:00
Maxime Coste
5ef4dd84b9 Small refactoring in remote.cc 2014-11-06 13:54:18 +00:00
Maxime Coste
80b50cd737 Simplify RemoteClient creation code 2014-11-05 13:57:12 +00:00
Maxime Coste
a3b29b1f11 Fix potential alignment bug 2014-11-05 13:50:06 +00:00
Maxime Coste
fc4142178f Port more code to StringView instead of const String& 2014-10-20 19:18:38 +01:00
Maxime Coste
d4a84125ef Use InternedStrings for buffer contents 2014-10-03 13:39:13 +01:00
Maxime Coste
1b54b65bb5 Add an operator[](CharCount) to String and StringView 2014-08-11 19:40:35 +01:00
Maxime Coste
a32b49acd1 Rename ColorPair to Face and ColorRegistry to FaceRegistry
Face also stores the attributes
2014-07-11 00:27:43 +01:00
Maxime Coste
8546788b43 Refactor LineAndColumn coordinates
BufferCoord -> ByteCoord
DisplayCoord -> CharCoord

Moved their definition along with LineAndColumn into coord.hh
2014-05-07 19:53:45 +01:00
Maxime Coste
4d45fa6588 Use StringView in UserInterface and NCursesUI 2014-04-30 19:39:52 +01:00
Maxime Coste
418a04f49d Support reading strings more that 2048 bytes
fixes #95
2014-04-23 22:21:04 +01:00
Maxime Coste
7af9863e51 Add an explicit refresh method to user interface
With this refresh method user interface can defer updating
the display until really needed.
2014-04-15 19:19:44 +01:00
Maxime Coste
98c6a6f17e RemoteClient process all available messages 2014-04-15 19:09:42 +01:00
Maxime Coste
203a7732f5 Add support for querying client environement variables
At connection, a remote client sends all its environement to the
server, which then provides access to client env through
kak_client_env_VAR_NAME variables in the shell.
2014-04-07 23:47:51 +01:00
Maxime Coste
9b7d8a93c8 code formatting tweak 2014-04-05 12:04:37 +01:00
Maxime Coste
b677f9da63 do not write the trailing nul char in send_commands
That triggered creation of a new client, followed by it's immediate
destruction due to the connection closing.
2014-03-25 09:23:11 +00:00
Maxime Coste
0bc57e43d2 Server: correctly handle Accepters lifetime
When exiting kakoune, ClientAccepters (now Server::Accepter) could
stay alive, which left an FDWatcher in the EventManager triggering
an assert. Now Server is handling their lifetime.
2014-03-25 09:21:20 +00:00
Maxime Coste
459cb212e5 Correctly handle failing to connect to the given session in client mode 2014-03-21 13:42:37 +00:00
Maxime Coste
11c62e583c Add -p <session> option to kak, which forward commands on stdin to session
This allows using directly the kak binary in place of socat for piping commands
to a foreing session.
2014-03-02 02:01:09 +00:00
Maxime Coste
e9442ea307 Rename connect_to's pid parameter to session 2014-03-02 02:00:13 +00:00
Maxime Coste
a6d14cecbe Remove session socket on error signal 2014-01-27 19:53:17 +00:00
Maxime Coste
3c959cee99 Pass title to UserInterface::info_show
Move unicode box generation and assistant code as
a NcursesUI implementation detail.
2013-10-11 00:17:22 +01:00
Maxime Coste
3021c7f60a Remove $kak_socket replaced with $kak_session
use /tmp/kak-$kak_session to get the socket path
2013-09-25 19:04:52 +01:00
Maxime Coste
415be1d2c7 Add a -s command line option for specifying session name 2013-09-19 19:54:14 +01:00
Maxime Coste
e70d75d6a6 Only redraw clients after handling all available events 2013-09-17 18:51:14 +01:00
Maxime Coste
06e06d6ea6 remove print_status from UserInterface, pass status line to draw
Client store the current status line. This way calls to print status
do not force the user interface to display directly.
2013-09-16 19:15:13 +01:00
Maxime Coste
1d790541f5 handle client disconnection without crashing 2013-08-28 19:20:12 +01:00
Maxime Coste
c6f08f6c34 fix c++11 union use in remote.cc 2013-07-31 00:32:51 +02:00
Maxime Coste
af8e8d27d4 Minor code cleanups 2013-07-28 16:40:02 +02:00
Maxime Coste
233cb530fc read<T>(int socket): type aliasing compliance 2013-07-26 01:50:36 +02:00
Maxime Coste
eedd37c09a memoryview: always pass by value 2013-07-26 01:50:36 +02:00
Maxime Coste
d5453152b3 Color,ColorPair: always pass by copy 2013-07-26 00:54:58 +02:00
Maxime Coste
d6425f1d50 merge AtomContent into DisplayAtom 2013-07-24 13:55:57 +01:00
Maxime Coste
c7e52a650d DisplayLine no longer map to a single buffer line, but to a buffer range 2013-07-24 01:33:12 +02:00
Maxime Coste
26f0fd4cc6 Use more std::* for string handling 2013-05-13 18:43:38 +02:00
Maxime Coste
56ab33c9d6 support specifying colors with RGB components 2013-05-13 14:25:05 +02:00
Maxime Coste
485a50bb4b handle client_removed exception out of ClientManager as well 2013-04-15 18:55:41 +02:00
Maxime Coste
35d0d5b2ea exceptions: use const char* what() instead of String description() 2013-04-11 13:57:35 +02:00
Maxime Coste
270e950cf1 sort includes directives 2013-04-09 20:05:40 +02:00
Maxime Coste
5adee4a6a7 rename assert to kak_assert to avoid collisions 2013-04-09 20:04:11 +02:00
Maxime Coste
f540566b1b UserInterface: status line messages are now DisplayLines
This add color support for the status line
2013-04-04 18:50:00 +02:00
Maxime Coste
1822b81d58 pass a color pair when displaying an information window 2013-04-04 14:04:38 +02:00
Maxime Coste
b58f614f40 Pass a fg and bg color when displaying a menu 2013-04-04 14:04:38 +02:00
Maxime Coste
4fbe2dc6bc compile with -pedantic option and fix warnings 2013-04-04 14:04:37 +02:00
Maxime Coste
b62c78f9e9 ConnectionAccepter: fix socket fd leak 2013-04-02 14:27:04 +02:00
Maxime Coste
e2d64b01d5 ClientAccepter triggers window redrawing after executing a command 2013-04-02 14:00:37 +02:00
Maxime Coste
dfa5318765 fix some style problems detected by cppcheck 2013-03-25 18:44:52 +01:00
Maxime Coste
0b45a725e4 move remoting code to remote.cc
ClientAccepter is now Server's implementation detail and all socket logic
are isolated in remote.cc
2013-03-14 10:23:35 +01:00
Maxime Coste
e428a9757f Modify network protocol to allow commands through the socket 2013-03-12 18:53:18 +01:00
Maxime Coste
f677d4ba32 Use a ColorPair in DisplayAtoms instead of separate fg/bg colors 2013-03-06 20:28:02 +01:00
Maxime Coste
310ec1f791 move input watching responsibility into UserInterface implementations 2013-01-14 18:50:17 +01:00
Maxime Coste
d2f0e2de66 RemoteClient owns the FDWatcher of it's socket 2013-01-11 18:44:02 +01:00
Maxime Coste
79d28e68dc Refactor EventManager
Watching a file descriptor is now done using a FDWatcher object
2013-01-10 19:10:42 +01:00
Maxime Coste
4b649d386c various code style fixes 2013-01-04 18:39:13 +01:00
Maxime Coste
d4f155cae7 new clients always takes last used buffer, support multiple file on command line 2012-12-28 13:51:14 +01:00
Maxime Coste
26632726ad Support initial command passing when a client is connecting 2012-12-18 21:20:36 +01:00
Maxime Coste
9236c87842 UserInterface: add info box support
using the info command, you can display an arbitrary string
in a tooltip box.
2012-12-14 19:04:34 +01:00
Maxime Coste
b63c658da5 remote.cc: move write function as member of Message 2012-12-13 18:49:29 +01:00
Maxime Coste
db3a953961 code cleanup in remote.cc 2012-12-13 18:49:29 +01:00
Maxime Coste
e8df81a39d RemoteClient: call get_key soon so that it may process a resize before size change checks are done 2012-12-03 18:51:28 +01:00
Maxime Coste
1602fcf012 Remote: read now retry when it did not get all the expected data 2012-11-19 19:07:32 +01:00
Maxime Coste
fe98ba7494 add some debug output to RemoteUI 2012-11-19 19:06:32 +01:00
Maxime Coste
1ea4b3998a Add a ClientManager for managing client lifetimes 2012-10-30 14:00:44 +01:00
Maxime Coste
254d43856d NCurses: refactor status line handling, and disambiguate status line from mode line 2012-10-29 19:01:57 +01:00
Maxime Coste
d9729cc29e Handle all available input before redrawing 2012-10-28 09:26:54 +01:00
Maxime Coste
13a081ed4a Remote: fix resize handling 2012-10-27 15:49:10 +02:00
Maxime Coste
61c8ef6ce4 remote: send resize message when needed 2012-10-26 16:14:51 +02:00
Maxime Coste
73aa11ac16 remote: check read/write results, detect disconnections 2012-10-26 13:45:32 +02:00
Maxime Coste
1c3f6c314f send actual dimensions of remote client at connection 2012-10-25 12:51:01 +02:00
Maxime Coste
b9eb939e05 Add some remote client support protocol code 2012-10-23 22:55:44 +02:00