#!/bin/sh # tmux prefix+i (display-message), in tmux's default template -- measured on # tmux 3.7c: "[0] 0:zsh, current pane 0 - (10:30 05-Oct-26)", i.e. # [#S] #I:#W, current pane #P - (%H:%M %d-%b-%y). Session is the workspace, # window index its place in the tab bar, window name the tab label. . "$(dirname "$0")/../lib.sh" p="$(active_pane)" ws="$(pane_info "$p" workspace_id)" tab="$(pane_info "$p" tab_id)" session="$("$H" workspace get "$ws" | jq -r '.result.workspace.label // empty')" line="$(workspace_tabs "$ws" | grep -n -F "$tab " | head -n 1)" window_index="${line%%:*}" window_name="$(printf '%s' "${line#*:}" | cut -f2)" say "[$session] $window_index:$window_name, current pane $(pane_index "$p") - ($(date '+%H:%M %d-%b-%y'))"