0

I would like to create a read-only mode for a specific window within a tmux session. I want to prevent any user input or interactions in that window, effectively making it read-only. Changing the window option to enable/disable this feature would be perfect.

I have searched for options within tmux, but it seems there is no built-in feature specifically for a read-only mode. Ideally, I am looking for a solution that allows me to make a window read-only in tmux while still displaying the contents and allowing other users to observe the session.

An example would be that users can comfortably monitor the log changes using the watch command without any risk of unintentional interference. Any suggestions or guidance on how to accomplish this would be greatly appreciated.

1 Answer 1

2

You can achieve a read-only mode for a tmux window (pane3) by disabling input for panes. Run the following tmux command1 2 to disable input for current pane

tmux select-pane -d 

To enable input in pane, run (in tmux : prompt)

select-pane -e

1 https://manpages.debian.org/testing/tmux/tmux.1.en.html#select-pane
2 https://www.reddit.com/r/tmux/comments/ytplkt/lock_and_unlock_the_current_window_pane_with_only/
3 https://github.com/tmux/tmux/wiki/Getting-Started#sessions-windows-and-panes

1
  • 1
    Exactly what I was looking for! I was able to set my specific window with tmux select-pane -t "$sn:$i" -d where sn is the session name and i is the window index.
    – kyrlon
    Oct 27, 2023 at 14:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .