# libtmux.Window.previous_layout

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/window.py#L931
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-window-previous_layout/

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

```
libtmux.Window.previous_layout(self) -> Window
```

Cycle to the previous layout via [`$ tmux previous-layout`](/en/tmux/latest/manual/previous-layout/).

```python
>>> pane1 = window.active_pane
>>> pane2 = window.split()
>>> window.previous_layout()
Window(...)
```

## In other ports

### Apply a window's previous layout preset

- TypeScript: [`window.Window.previousLayout`](/en/ts/latest/reference/window-window-previouslayout/) (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)
- 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)
