aboutsummaryrefslogtreecommitdiff
path: root/cmd-new-session.c
Commit message (Collapse)AuthorAge
...
* Use the notify name string instead of going via an enum and changenicm2016-10-16
| | | | existing hooks to use notifys instead.
* Mass rename struct cmd_q to struct cmdq_item and related.nicm2016-10-16
|
* Rewrite command queue handling. Each client still has a command queue,nicm2016-10-16
| | | | | | | | | | | | | | | but there is also now a global command queue. Instead of command queues being dispatched on demand from wherever the command happens to be added, they are now all dispatched from the top level server loop. Command queues may now also include callbacks as well as commands, and items may be inserted after the current command as well as at the end. This all makes command queues significantly more predictable and easier to use, and avoids the complex multiple nested command queues used by source-file, if-shell and friends. A mass rename of struct cmdq to a better name (cmdq_item probably) is coming.
* Trying to do hooks generically is way too complicated and unreliable andnicm2016-10-13
| | | | | | | | | | | | | | | | | | confusing, particularly trying to automatically figure out what target hooks should be using. So simplify it: - drop before hooks entirely, they don't seem to be very useful; - commands with special requirements now fire their own after hook (for example, if they change session or window, or if they have -t and -s and need to choose which one the hook uses as current target); - commands with no special requirements can have the CMD_AFTERHOOK flag added and they will use the -t state. At the moment new-session, new-window, split-window fire their own hook, and display-message uses the flag. The remaining commands still need to be looked at.
* Some improvements and bug fixes for hooks:nicm2016-10-13
| | | | | | | | | | | | | | | | | | | | | - Prepare the state again before the "after" hooks are run, because the command may have killed or moved windows. - Use the hooks list from the newly prepared target, not the old hooks list (only matters for new-session really). - Correctly detect an invalid current state and ignore it in cmd_find_target ("killw; swapw"). - Change neww, new, killp, killw, splitw, swapp, swapw to update the current state (used if no explicit target is given) to something more useful after they have finished. For example, neww changes it to the newly created window. Hooks are still relatively new and primitive so there are likely to be more changes to come. Parts based on bug reports from Uwe Werler and Iblis Lin.
* Add static in cmd-* and fix a few other nits.nicm2016-10-10
|
* Do not use c->cwd or s->cwd if it is NULL, found by Ben Boeckel.nicm2016-03-05
|
* Set up -t flag properly when passing new-session -A off tonicm2016-02-04
| | | | attach-session, GitHub issue 295.
* Fix new-session with -t after command flags changes, reported by Michael ↵nicm2016-01-31
| | | | Graczyk.
* I no longer use my SourceForge address so replace it.nicm2016-01-19
|
* Instead of combined flags for -c, -s, -t, split into different setsnicm2015-12-14
| | | | using an enum and simplify the parsing code.
* Use member names in cmd_entry definitions so I stop getting confusednicm2015-12-13
| | | | about the order.
* Instead of every command resolving the target (-t or -s) itself, preparenicm2015-12-13
| | | | | | | | | | | | | | | | the state (client, session, winlink, pane) for it it before entering the command. Each command provides some flags that tell the prepare step what it is expecting. This is a requirement for having hooks on commands (for example, if you hook "select-window -t1:2", the hook command should to operate on window 1:2 not whatever it thinks is the current window), and should allow some other target improvements. The old cmd_find_* functions remain for the moment but that layer will be dropped later. Joint work with Thomas Adam.
* Add key-table option to set the default key table for a session, allowsnicm2015-12-12
| | | | different key bindings for different sessions and a few other things.
* Add cmdq as an argument to format_create and add a format for thenicm2015-12-11
| | | | command name (will also be used for more later).
* Remove format_create_flags and just pass flags to format_create.nicm2015-12-08
|
* Fall back silently to ~ or / rather than checking -c with access(), thisnicm2015-10-31
| | | | was the old behaviour.
* Because pledge(2) does not allow us to pass directory file descriptorsnicm2015-10-31
| | | | | | | | | around, we can't use file descriptors for the working directory because we will be unable to pass it to a privileged process to tell it where to read or write files or spawn children. So move tmux back to using strings for the current working directory. We try to check it exists with access() when it is set but ultimately fall back to ~ if it fails at time of use (or / if that fails too).
* Like options, move the environ struct into environ.c.nicm2015-10-28
|
* Move struct options into options.c.nicm2015-10-27
|
* Break the common process set up, event loop and imsg dispatch codenicm2015-10-27
| | | | | between server and client out into a separate internal API. This will make it easier to add another process.
* Remove some unnecessary checks before free().nicm2015-10-23
|
* Add session_last_attached time and format, from Sina Siadat.nicm2015-09-10
|
* Make session_update_activity more useful and use it in more places.nicm2015-08-28
|
* Run status update on a per-client timer at status-interval.nicm2015-08-28
|
* Add -E flag when attaching or switching client to bypassnicm2015-06-07
| | | | update-environment, from Steven Lu.
* Move the nested check from client to server and compare the client ttynicm2015-06-04
| | | | | name to all the pane pty names instead of comparing socket paths. This means that "new -d" will work without unsetting $TMUX.
* Use RB_MIN to get the lowest index for the current window when creatingnicm2015-05-29
| | | | grouped sessions, rather than using RB_ROOT.
* Rewrite of the target resolution internals to be simpler and morenicm2015-04-27
| | | | | | | consistent but with much less duplication, but keeping the same internal API. Also adds more readable aliases for some of the special tokens used in targets (eg "{start}" instead of "^"). Some behaviours may have changed, for example prefix matches now happen before fnmatch.
* Wrap all the individual format_* calls in a single format_defaultsnicm2015-02-05
| | | | functions.
* Move template defines back into .c files.nicm2014-10-20
|
* Instead of setting up the default keys by building the key structnicm2014-10-20
| | | | | | | | | directly with a helper function in the cmd_entry, include a table of bind-key commands and pass them through the command parser and a temporary cmd_q. As well as being smaller, this will allow default bindings to be command sequences which will probably be needed soon.
* If multiple arguments are given to new-session, new-window,nicm2014-05-13
| | | | | | split-window, respawn-window or respawn-pane, pass them directly to execvp() to help avoid quoting problems. One argument still goes to "sh -c" like before. Requested by many over the years. Patch from J Raynor.
* Set PATH explicitly, either from client or sessionnicm2014-04-17
| | | | | environment. Previously it came from the session environment. From J Raynor.
* Remove some unnecessary includes and fix a typo.nicm2014-04-17
|
* Change terminal-overrides to a server option (now that we have them), itnicm2014-02-23
| | | | doesn't make much sense as a session option.
* Handle empty current directory more gracefully.nicm2013-11-22
|
* Don't boke when figuring out working directory from configuration file.nicm2013-10-10
|
* Alter how tmux handles the working directory to internally use filenicm2013-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | descriptors rather than strings. - Each session still has a current working directory. - New sessions still get their working directory from the client that created them or its attached session if any. - New windows are created by default in the session working directory. - The -c flag to new, neww, splitw allows the working directory to be overridden. - The -c flag to attach let's the session working directory be changed. - The default-path option has been removed. To get the equivalent to default-path '.', do: bind c neww -c $PWD To get the equivalent of default-path '~', do: bind c neww -c ~ This also changes the client identify protocol to be a set of messages rather than one as well as some other changes that should make it easier to make backwards-compatible protocol changes in future.
* Remove CMD_SENDENVIRON.nicm2013-10-10
|
* Add -P and -F to new-session.Nicholas Marriott2013-03-25
|
* Add -A flag to new-session to make it behave like attach-session if theNicholas Marriott2013-03-24
| | | | session exists. If -A is used, -D behaves like -d to attach-session.
* Add a command queue to standardize and simplify commands that call otherNicholas Marriott2013-03-24
| | | | | | | | | | | | | | | | | | | | | | commands and allow a command to block execution of subsequent commands. This allows run-shell and if-shell to be synchronous which has been much requested. Each client has a default command queue and commands are consumed one at a time from it. A command may suspend execution from the queue by returning CMD_RETURN_WAIT and then resume it by calling cmd_continue() - for example run-shell does this from the callback that is fired after the job is freed. When the command queue becomes empty, command clients are automatically exited (unless attaching). A callback is also fired - this is used for nested commands in, for example, if-shell which can block execution of the client's cmdq until a new cmdq becomes empty. Also merge all the old error/info/print functions together and lose the old curclient/cmdclient distinction - a cmdq is bound to one client (or none if in the configuration file), this is a command client if c->session is NULL otherwise an attached client.
* Use the CMD_*_USAGE defines consistently, from Thomas Adam.Nicholas Marriott2012-12-09
|
* Use a utility function for common code to show errors in config file,Nicholas Marriott2012-11-19
| | | | from Thomas Adam.
* Make command exec functions return an enum rather than -1/0/1 values andNicholas Marriott2012-07-11
| | | | | | add a new value to mean "leave client running but don't attach" to fix problems with using some commands in a command sequence. Most of the work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.
* xfree is not particularly helpful, remove it. From Thomas Adam.Nicholas Marriott2012-07-10
|
* Add a helper function to send ready message.Nicholas Marriott2012-05-22
|
* Add a helper function to open the terminal for attach-/new-session.Nicholas Marriott2012-05-06
|
* Add notify hooks for various events, the functions are currently emptyNicholas Marriott2012-03-17
| | | | stubs but will be filled in for control mode later. From George Nachman.