There's this item on the tmux TODO list: * way to set socket path from config file
I was thinking of trying to implement it, but I thought it needed discussion first. I was thinking that there could be a command, like set-client or set-flag. This could be used to set the socket path (set-client -S /path/to/socket), but it could also be extended to other flags (-u?) that someone might want to set in the config file instead of on the command line. I thought of 2 possibilities for how to mix the client and server commands in the config file. First way: Commands in the config file intended for the client would start with "#!". Before starting the server, the client would set cmd_table to a table with just the "set-client" command so it could use cmd_string_parse(). It would then call client_load_cfg() which would parse the config file, but only look for lines starting with "#!", or maybe "#!set-client". After processing the file, it would set cmd_table to what the server needs. The benefit of this way is that the server doesn't really need to be modified. When it calls load_cfg(), the client commands are ignored, just like any other comment. Second way: Have a client_cmd_table and a server_cmd_table. When the client starts it sets cmd_table to client_cmd_table and ignore_table to server_cmd_table. It then calls load_cfg(). cmd_parse() will be modified so that, if a cmd entry isn't found in cmd_table, it checks to see if the cmd is in ignore_table. If so, the command is ignored. If not, it returns an error like it does now. Once the client has finished calling load_cfg(), it switches cmd_table and ignore_table and starts the server. The server calls load_cfg() as it normally does. It will carry out server commands and ignore client commands. The benefit of this way is that the client and server commands can be mixed in the config file with no special syntax. Does any of this sound like something you might like me to pursue? Do you have some other ideas for how you'd like to see this implemented? ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users