LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-22-2024, 09:24 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Rep: Reputation: 255Reputation: 255Reputation: 255
How to lock TMUX ?


Hello

ctrl b + X is to lock the tmux?

I am unsure if it works

Kind regards
 
Old 03-22-2024, 09:27 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,311
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
You can make tmux read-only but that is voluntary, being done by run-time options with the client. There are tricks to enforce that though.

Can you elaborate on what you are trying to do?
 
Old 03-23-2024, 03:30 AM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
tmux ; ssh towhateverip top ; annd then I wanna get a lock of tmux
 
Old 03-23-2024, 04:12 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,311
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Quote:
Originally Posted by Xeratul View Post
tmux ; ssh towhateverip top ; annd then I wanna get a lock of tmux
If you want top to run once, then use the -n option.

Or if you want tmux to run read-only then you can make a new, read-only client session:

Code:
tmux \
        new-session -d -s Top \; \
        rename-window -t Top:0 Monitoring \; \
        split-window -t Top:Monitoring \; \
        send-keys -t Top:Monitoring.0 'ssh whateverip1 "top"' C-m \; \
        send-keys -t Top:Monitoring.1 'ssh whateverip2 "top"' C-m \; \
        attach-session -t Top -f read-only
Note that -t read-only status is on the honor system. The same account (or other account if access is shared) can launch a new client with normal read-write permissions.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Tmux Plugin Manager: A Must-Have Tool For Tmux Power Users LXer Syndicated Linux News 0 10-15-2023 01:33 AM
[SOLVED] Unable to Install TMUX TPM Plugin on Rocky Linux 8.7 with TMUX version 2.7 LearningSponge Linux - Software 1 04-02-2023 04:25 AM
deian yum lock [ ERR] Reading state information E: Could not get lock /var/lock/aptit jayakumar01 Linux - Server 1 12-05-2011 11:26 AM
Caps Lock & Scroll Lock Flashing thedug Linux - General 6 06-07-2008 09:43 PM
Can't read lock file /tmp/.X0-lock squinn Linux - Newbie 3 07-13-2004 03:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration