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

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

```
method previous-window(Bool :$activity = False --> Result:D)
```

Select the previous session window, optionally restricting to activity alerts.

Select the previous session window, optionally restricting to activity alerts.

## Parameters

- `$activity?` (`Bool`)

## tmux command

The tmux commands behind `previous-window`.

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

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_previous_window_entry`](/en/tmux/latest/reference/c-variable-cmd_previous_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

Move to the previous window of a session

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Session.previous_window`](/en/py/latest/reference/libtmux-session-previous_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.previous_window`](/en/rs/latest/reference/session-session-previous_window/) (method) |
| Go | [`tmux.Session.PreviousWindow`](/en/go/latest/reference/tmux-session-previouswindow/) (method) |
| Java | [`io.github.libtmux.Session.previousWindow`](/en/java/latest/reference/io-github-libtmux-session-session-previouswindow/) (method) |
| C# | [`LibTmux.Session.SelectPreviousWindowAsync`](/en/csharp/latest/reference/libtmux-session-selectpreviouswindowasync/) (method) |
| C++ | [`libtmux::Session::select_previous_window`](/en/cxx/latest/reference/libtmux-session-select_previous_window/) (method) |
| Swift | [`Server.selectPreviousWindow(in:)`](/en/swift/latest/reference/server-selectpreviouswindow(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#.
