summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
AgeCommit message (Collapse)Author
2017-08-30Pass flags into cmd_find_from_* to fix prefer-unattached, reported bynicm
Thomas Sattler.
2017-07-21Add -c for respawn-pane and respawn-window, from J Raynor.nicm
2017-05-28Change so that sessions created detached (-d or no client) are alwaysnicm
80x24 and the status line is not applied until they attach. Also make -x and -y work for control clients whether the session is detached or not.
2017-04-22new -A should use the session name.nicm
2017-04-22Get rid of the extra layer of flags and cmd_prepare() and just store thenicm
CMD_FIND_* flags in the cmd_entry and call it for the command. Commands with special requirements call it themselves and update the target for hooks to use.
2017-04-22Mouse bindings and hooks set up an initial current state when running anicm
command. This is used for the session, window and pane for all commands in the command sequence if there is no -t or -s. However, using it for all commands in the command sequence means that if the active pane or current session is changed, subsequent commands still use the previous state. So make commands which explicitly change the current state (such as neww and selectp) update it themselves for later commands. Commands which may invalidate the state (like killp) are already OK because an invalid state will be ignored. Also fill in the current state for all key bindings rather than just the mouse, so that any omissions are easier to spot.
2017-04-21Store state shared between multiple commands in the queue in a sharednicm
structure.
2017-03-08Add a helper function for the most common format_create/defaults/expandnicm
pattern.
2017-02-09Instead of numbering session groups, give them a name which may be givennicm
to -t instead of a target session. Also allow them to contain only one session.
2017-02-06Cancel key table when switching session, unless the key is going tonicm
repeat. Reported by Amos Bird.
2017-02-03Add a window or pane id "tag" to each format tree and use it to separatenicm
jobs, this means that if the same job is used for different windows or panes (for example in pane-border-format), it will be run separately for each pane.
2017-01-28Do not clear the key table when changing session on a client, so thatnicm
switch-client and friends work with bind -n.
2017-01-24Make update-environment an array as well.nicm
2017-01-13Make options_get_string return const string.nicm
2016-11-16Do not stop dragging when the wheel is pressed, from Artem Fokin.nicm
2016-10-19Move session-create hook out of session_create so it works with grouped ↵nicm
sessions.
2016-10-16Use the notify name string instead of going via an enum and changenicm
existing hooks to use notifys instead.
2016-10-16Mass rename struct cmd_q to struct cmdq_item and related.nicm
2016-10-16Rewrite command queue handling. Each client still has a command queue,nicm
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.
2016-10-13Trying to do hooks generically is way too complicated and unreliable andnicm
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.
2016-10-13Some improvements and bug fixes for hooks:nicm
- 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.
2016-10-10Add static in cmd-* and fix a few other nits.nicm
2016-03-05Do not use c->cwd or s->cwd if it is NULL, found by Ben Boeckel.nicm
2016-02-04Set up -t flag properly when passing new-session -A off tonicm
attach-session, GitHub issue 295.
2016-01-31Fix new-session with -t after command flags changes, reported by Michael ↵nicm
Graczyk.
2016-01-19I no longer use my SourceForge address so replace it.nicm
2015-12-14Instead of combined flags for -c, -s, -t, split into different setsnicm
using an enum and simplify the parsing code.
2015-12-13Use member names in cmd_entry definitions so I stop getting confusednicm
about the order.
2015-12-13Instead of every command resolving the target (-t or -s) itself, preparenicm
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.
2015-12-12Add key-table option to set the default key table for a session, allowsnicm
different key bindings for different sessions and a few other things.
2015-12-11Add cmdq as an argument to format_create and add a format for thenicm
command name (will also be used for more later).
2015-12-08Remove format_create_flags and just pass flags to format_create.nicm
2015-10-31Fall back silently to ~ or / rather than checking -c with access(), thisnicm
was the old behaviour.
2015-10-31Because pledge(2) does not allow us to pass directory file descriptorsnicm
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).
2015-10-28Like options, move the environ struct into environ.c.nicm
2015-10-27Move struct options into options.c.nicm
2015-10-27Break the common process set up, event loop and imsg dispatch codenicm
between server and client out into a separate internal API. This will make it easier to add another process.
2015-10-23Remove some unnecessary checks before free().nicm
2015-09-10Add session_last_attached time and format, from Sina Siadat.nicm
2015-08-28Make session_update_activity more useful and use it in more places.nicm
2015-08-28Run status update on a per-client timer at status-interval.nicm
2015-06-07Add -E flag when attaching or switching client to bypassnicm
update-environment, from Steven Lu.
2015-06-04Move the nested check from client to server and compare the client ttynicm
name to all the pane pty names instead of comparing socket paths. This means that "new -d" will work without unsetting $TMUX.
2015-05-29Use RB_MIN to get the lowest index for the current window when creatingnicm
grouped sessions, rather than using RB_ROOT.
2015-04-27Rewrite of the target resolution internals to be simpler and morenicm
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.
2015-02-05Wrap all the individual format_* calls in a single format_defaultsnicm
functions.
2014-10-20Move template defines back into .c files.nicm
2014-10-20Instead of setting up the default keys by building the key structnicm
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.
2014-05-13If multiple arguments are given to new-session, new-window,nicm
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.
2014-04-17Set PATH explicitly, either from client or sessionnicm
environment. Previously it came from the session environment. From J Raynor.