summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-new-session.c
AgeCommit message (Collapse)Author
2014-04-17Set PATH explicitly, either from client or sessionNicholas Marriott
environment. Previously it came from the session environment. From J Raynor.
2014-04-17Remove some unnecessary includes and fix a typo.Nicholas Marriott
2014-02-23Change terminal-overrides to a server option (now that we have them), itNicholas Marriott
doesn't make much sense as a session option.
2013-11-22Handle empty current directory more gracefully.Nicholas Marriott
2013-10-10Don't boke when figuring out working directory from configuration file.Nicholas Marriott
2013-10-10Alter how tmux handles the working directory to internally use fileNicholas Marriott
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.
2013-10-10Remove CMD_SENDENVIRON.Nicholas Marriott
2013-10-10Support -c for new-session, based on code from J Raynor.Nicholas Marriott
2013-10-10Remove the barely-used and unnecessary command check() function.Nicholas Marriott
2013-03-25Add -P and -F to new-session.Nicholas Marriott
2013-03-24Add -A flag to new-session to make it behave like attach-session if theNicholas Marriott
session exists. If -A is used, -D behaves like -d to attach-session.
2013-03-24Add a command queue to standardize and simplify commands that call otherNicholas Marriott
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.
2012-12-09Use the CMD_*_USAGE defines consistently, from Thomas Adam.Nicholas Marriott
2012-11-19Use a utility function for common code to show errors in config file,Nicholas Marriott
from Thomas Adam.
2012-07-11Make command exec functions return an enum rather than -1/0/1 values andNicholas Marriott
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.
2012-07-10xfree is not particularly helpful, remove it. From Thomas Adam.Nicholas Marriott
2012-05-22Add a helper function to send ready message.Nicholas Marriott
2012-05-06Add a helper function to open the terminal for attach-/new-session.Nicholas Marriott
2012-03-17Add notify hooks for various events, the functions are currently emptyNicholas Marriott
stubs but will be filled in for control mode later. From George Nachman.
2012-02-02Move window name changes into wrapper function window_set_name, fromNicholas Marriott
George Nachman.
2011-10-23For initial session, use size of command client even if detached.Nicholas Marriott
2011-04-06Change so that an empty session name always means the current sessionsNicholas Marriott
even if given with, for example, -t '', and explicitly forbid empty session names and those containing a : when they are created.
2011-04-05Add a flag to cmd_find_session so that attach-session can preferNicholas Marriott
unattached sessions when choosing the most recently used (if -t is not given). Suggested by claudio@.
2011-02-03Don't require -d with -x or -y since it could be in the config file.Nicholas Marriott
2011-01-14Support -x and -y for new-session to specify the initial size of theNicholas Marriott
window if created detached with -d.
2011-01-04Clean up and simplify tmux command argument parsing.Nicholas Marriott
Originally, tmux commands were parsed in the client process into a struct with the command data which was then serialised and sent to the server to be executed. The parsing was later moved into the server (an argv was sent from the client), but the parse step and intermediate struct was kept. This change removes that struct and the separate parse step. Argument parsing and printing is now common to all commands (in arguments.c) with each command left with just an optional check function (to validate the arguments at parse time), the exec function and a function to set up any key bindings (renamed from the old init function). This is overall more simple and consistent. There should be no changes to any commands behaviour or syntax although as this touches every command please watch for any unexpected changes.
2011-01-01Don't reset the activity timer for unattached sessions every second,Nicholas Marriott
this screws up the choice of most-recently-used. Instead, break the time update into a little function and do it when the session is attached. Pointed out by joshe@.
2010-12-20Use pointer rather than index for the client's last session.Nicholas Marriott
2010-12-11Track the last session for a client and add a flag to switch-client andNicholas Marriott
a key binding (L) to move a client back to its last session.
2010-06-27Store the current working directory in the session, change the default-pathNicholas Marriott
option to default to empty and make that mean that the stored session CWD is used.
2010-04-06Merge copy mode and output mode, dropping the latter. Idea and code fromNicholas Marriott
Micah Cowan.
2010-02-22Display -t argument to new-session, from Tiago Cunha.Nicholas Marriott
2010-02-06Use the array.h code for the causes list.Nicholas Marriott
2010-02-06Instead of bailing out on the first configuration file error, carry on,Nicholas Marriott
collecting all the errors, then start with the active window in more mode displaying them.
2009-12-03Massive spaces->tabs and trailing whitespace cleanup, hopefully for the lastNicholas Marriott
time now I've configured emacs to make them displayed in really annoying colours...
2009-11-26Remove a couple of unused arguments where possible, and add /* ARGSUSED */ toNicholas Marriott
the rest to reduce lint output.
2009-11-13Get rid of the ugly CMD_CHFLAG macro and use a const string (eg "dDU") in theNicholas Marriott
command entry structs and a couple of functions to check/set the flags.
2009-11-11Only need to chmod +x or -x the socket when a client is created, lost orNicholas Marriott
attached, rather than every event loop.
2009-10-10Add "grouped sessions" which have independent name, options, current window andNicholas Marriott
so on but where the linked windows are synchronized (ie creating, killing windows and so on are mirrored between the sessions). A grouped session may be created by passing -t to new-session. Had this around for a while, tested by a couple of people.
2009-09-21Use KEYC_NONE constant instead of 0 on init.Nicholas Marriott
2009-09-16Rather than constructing an entire termios struct from ttydefaults.h, just letNicholas Marriott
forkpty do it and then alter the bits that should be changed after fork. A little neater and more portable.
2009-09-15The default terminal size should be 80x24, not 80x25.Nicholas Marriott
2009-09-12tmux always outputs \177 for backspace, so explicitly set VERASE to \177 forNicholas Marriott
new windows.
2009-08-23Some code tidying.Nicholas Marriott
2009-08-21Move reading termios settings to before tty_open alters them, and expand theNicholas Marriott
comment.
2009-08-19Use cfsetispeed/cfsetospeed to set termios speed members.Nicholas Marriott
2009-08-13Add a base-index session option to specify the first index checked when lookingNicholas Marriott
for an index for a new window.
2009-08-13Rather than telling the client to exit in the function when creating a newNicholas Marriott
session detached, let the caller do it. Allows "tmux new -d \; attach" to work.
2009-08-13When creating a new session from the command-line where there is an externalNicholas Marriott
terminal, copy the termios(4) special characters and use them for new windows created in the new session. Suggested by Theo.
2009-08-08Infrastructure and commands to manage the environment for processes startedNicholas Marriott
within tmux. There is a global environment, copied from the external environment when the server is started and each sesssion has an (initially empty) session environment which overrides it. New commands set-environment and show-environment manipulate or display the environments. A new session option, update-environment, is a space-separated list of variables which are updated from the external environment into the session environment every time a new session is created - the default is DISPLAY.