pub struct NewWindow<'a> {
    pub after: bool,
    pub before: bool,
    pub detached: bool,
    pub kill: bool,
    pub print: bool,
    pub select: bool,
    pub start_directory: Option<Cow<'a, str>>,
    pub environment: Option<Cow<'a, str>>,
    pub format: Option<Cow<'a, str>>,
    pub window_name: Option<Cow<'a, str>>,
    pub target_window: Option<Cow<'a, str>>,
    pub shell_command: Option<Cow<'a, str>>,
}
Expand description

Structure for creating new window, using tmux new-window command

§Manual

tmux ^3.2:

new-window [-abdkPS] [-c start-directory] [-e environment] [-F format] [-n window-name]
[-t target-window] [shell-command]
(alias: neww)

tmux ^3.0:

new-window [-adkP] [-c start-directory] [-e environment] [-F format] [-n window-name] [-t
target-window] [shell-command]
(alias: neww)

tmux ^1.7:

new-window [-adkP] [-c start-directory] [-F format] [-n window-name] [-t target-window]
[shell-command]
(alias: neww)

tmux ^1.5:

new-window [-adkP] [-n window-name] [-t target-window] [shell-command]
(alias: neww)

tmux ^1.3:

new-window [-adk] [-n window-name] [-t target-window] [shell-command]
(alias: neww)

tmux ^1.2:

new-window [-dk] [-n window-name] [-t target-window] [shell-command]
(alias: neww)

tmux ^1.0:

new-window [-dk] [-n window-name] [-t target-window] [command]
(alias: neww)

tmux ^0.8:

new-window [-d] [-n window-name] [-t target-window] [command]
(alias: neww)

Fields§

§after: bool

[-a] - new window is inserted at the next index up from the specified target-window

§before: bool

[-b] - new window is inserted at the next index before the specified target-window

§detached: bool

[-d] - the session does not make the new window the current window

§kill: bool

[-k] - destroy if already exists

§print: bool

[-P] - print information about the new window after it has been created

§select: bool

[-S] - is given and a window named window-name already exists, it is selected

§start_directory: Option<Cow<'a, str>>

[-c start-directory] - start-directory

§environment: Option<Cow<'a, str>>

[-e environment] - environment

§format: Option<Cow<'a, str>>

[-F format] - format

§window_name: Option<Cow<'a, str>>

[-n window-name] - window-name

§target_window: Option<Cow<'a, str>>

[-t target-window] - target-window

§shell_command: Option<Cow<'a, str>>

[shell-command] - shell-command

Implementations§

source§

impl<'a> NewWindow<'a>

source

pub fn new() -> Self

source

pub fn after(self) -> Self

[-a] - new window is inserted at the next index up from the specified target-window

source

pub fn before(self) -> Self

[-b] - new window is inserted at the next index before the specified target-window

source

pub fn detached(self) -> Self

[-d] - the session does not make the new window the current window

source

pub fn kill(self) -> Self

[-k] - destroy if already exists

source

pub fn print(self) -> Self

[-P] - print information about the new window after it has been created

source

pub fn select(self) -> Self

[-S] - is given and a window named window-name already exists, it is selected

source

pub fn start_directory<S: Into<Cow<'a, str>>>(self, start_directory: S) -> Self

[-c start-directory] - start-directory

source

pub fn environment<S: Into<Cow<'a, str>>>(self, environment: S) -> Self

[-e environment] - environment

source

pub fn format<S: Into<Cow<'a, str>>>(self, format: S) -> Self

[-F format] - format

source

pub fn window_name<S: Into<Cow<'a, str>>>(self, window_name: S) -> Self

[-n window-name] - window-name

source

pub fn target_window<S: Into<Cow<'a, str>>>(self, target_window: S) -> Self

[-t target-window] - target-window

source

pub fn shell_command<S: Into<Cow<'a, str>>>(self, shell_command: S) -> Self

[shell-command] - shell-command

source

pub fn build(self) -> TmuxCommand<'a>

Trait Implementations§

source§

impl<'a> Clone for NewWindow<'a>

source§

fn clone(&self) -> NewWindow<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for NewWindow<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for NewWindow<'a>

source§

fn default() -> NewWindow<'a>

Returns the “default value” for a type. Read more
source§

impl<'a> From<NewWindow<'a>> for TmuxCommand<'a>

source§

fn from(item: NewWindow<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> Hash for NewWindow<'a>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a> Ord for NewWindow<'a>

source§

fn cmp(&self, other: &NewWindow<'a>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<'a> PartialEq for NewWindow<'a>

source§

fn eq(&self, other: &NewWindow<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialOrd for NewWindow<'a>

source§

fn partial_cmp(&self, other: &NewWindow<'a>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a> Eq for NewWindow<'a>

source§

impl<'a> StructuralPartialEq for NewWindow<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for NewWindow<'a>

§

impl<'a> Send for NewWindow<'a>

§

impl<'a> Sync for NewWindow<'a>

§

impl<'a> Unpin for NewWindow<'a>

§

impl<'a> UnwindSafe for NewWindow<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.