# LibTmux::Model::SessionRef.last-window

- **Module:** LibTmux::Model
- **Package:** LibTmux
- **Language:** Raku
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-raku/blob/0b5dd3d32e20f83a0069874e33eab0eb48f55962/lib/LibTmux/Model.rakumod#L161
- **Page:** https://libtmux.org/en/raku/latest/reference/libtmux-model-sessionref-last-window/

```
method last-window(--> Result:D)
```

Select the session's previous current window.

Select the session's previous current window.

## tmux command

The tmux commands behind `last-window`.

- [`last-window`](/en/tmux/latest/manual/last-window/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_last_window_entry`](/en/tmux/latest/reference/c-variable-cmd_last_window_entry/) (attribute)
- [`cmd_select_window_exec`](/en/tmux/latest/reference/c-function-cmd-select-window-c-cmd_select_window_exec/) (function)

## In other ports

Return to the window that was active before

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Session.last_window`](/en/py/latest/reference/libtmux-session-last_window/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | `Session.selectWindow` takes `next`, `previous` or `last` |
| Rust | [`session.Session.last_window`](/en/rs/latest/reference/session-session-last_window/) (method) |
| Go | [`tmux.Session.LastWindow`](/en/go/latest/reference/tmux-session-lastwindow/) (method) |
| Java | [`io.github.libtmux.Session.lastWindow`](/en/java/latest/reference/io-github-libtmux-session-session-lastwindow/) (method) |
| C# | [`LibTmux.Session.SelectLastWindowAsync`](/en/csharp/latest/reference/libtmux-session-selectlastwindowasync/) (method) |
| C++ | [`libtmux::Session::select_last_window`](/en/cxx/latest/reference/libtmux-session-select_last_window/) (method) |
| Swift | [`Server.selectLastWindow(in:)`](/en/swift/latest/reference/server-selectlastwindow(in-)/) (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#.
