# LibTmux::Model::WindowRef.previous-layout

- **Module:** LibTmux::Model
- **Package:** LibTmux
- **Language:** Raku
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-raku/blob/0b5dd3d32e20f83a0069874e33eab0eb48f55962/lib/LibTmux/Model.rakumod#L202
- **Page:** https://libtmux.org/en/raku/latest/reference/libtmux-model-windowref-previous-layout/

```
method previous-layout(--> Result:D)
```

Apply the previous tmux layout to this physical window.

Apply the previous tmux layout to this physical window.

## tmux command

The tmux commands behind `previous-layout`.

- [`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) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| 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) |
| 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) |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |

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