# window.Window.previousLayout

- **Module:** window
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/window.ts#L328
- **Page:** https://libtmux.org/en/ts/latest/reference/window-window-previouslayout/

```
previousLayout(): Promise<void>
```

Apply this window's previous layout preset.

## Examples

```ts
await window.previousLayout();
```

## tmux command

The tmux commands behind `previousLayout`.

- [`previous-layout`](/en/tmux/latest/manual/previous-layout/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_previous_layout_entry`](/en/tmux/latest/reference/c-variable-cmd_previous_layout_entry/) (attribute)
- [`cmd_select_layout_exec`](/en/tmux/latest/reference/c-function-cmd-select-layout-c-cmd_select_layout_exec/) (function)

## In other ports

Apply a window's previous layout preset

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window.previous_layout`](/en/py/latest/reference/libtmux-window-previous_layout/) (method) |
| Rust | [`window.Window.previous_layout`](/en/rs/latest/reference/window-window-previous_layout/) (method) |
| Go | [`tmux.Window.PreviousLayout`](/en/go/latest/reference/tmux-window-previouslayout/) (method) |
| Java | `Window.applyLayout` restores a named layout; there is no previous step |
| C# | [`LibTmux.Window.SelectPreviousLayoutAsync`](/en/csharp/latest/reference/libtmux-window-selectpreviouslayoutasync/) (method) |
| C++ | [`libtmux::Window::previous_layout`](/en/cxx/latest/reference/libtmux-window-previous_layout/) (method) |
| Swift | [`Server.previousLayout(_:)`](/en/swift/latest/reference/server-previouslayout(_-)/) (method) |

No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Elixir, Kotlin, Scala or F#.
