Server.new_session
Create new session, returns new Session .
Source and package
-
Description#
Uses
-Pflag to print session info,-Ffor return formatting returns new Session object.$ tmux new-session -dwill create the session in the background$ tmux new-session -Adwill move to the session name if it already exists. todo: make an option to handle this.Examples#
Sessions can be created without a session name (0.14.2+):
>>> server.new_session()Session($2 2)Creating them in succession will enumerate IDs (via tmux):
>>> server.new_session()Session($3 3)With a
session_name:>>> server.new_session(session_name='my session')Session($4 my session)- Parameters
-
-
session_name(str | None) # – :: $ tmux new-session -s <session_name> -
attach(bool) # – create session in the foreground.attach=Falseis equivalent to:: $ tmux new-session -d -
start_directory(StrPath | None) # -
window_name(str | None) # -
window_command(str | None) # -
detach_others(bool | None) # -
client_flags(str | None) #
-
- Returns
- Raises
tmux command
new-sessionIn other ports Create a session
- PowerShell No source-verified PowerShell equivalent is recorded for this operation.
- Julia No source-verified Julia equivalent is recorded for this operation.
- Ruby
- Lua
- TypeScript
- Rust
- Go
- Java
- C#
- C++
- Swift
- Kotlin
- Scala
- F# No source-verified F# equivalent is recorded for this operation.