Zooming tmux panes | หด-ขยาย panes ง่ายในพริบตา

ใช้ tmux ย่างเข้าปีที่ 3ไม่เคยรู้มาก่อนเลยว่ามันสามารถ zooming panesได้ด้วย
แต่พอรู้เท่านั้นแหละ…รู้เลย!!!

หมายเหตุ: สำหรับใครที่ยังไม่รู้ว่า tmux คืออะไร ใช้แล้วดียังไง แนะนำให้ไปอ่านบทความ ไผ๋บ่มัก tmux เขียนดี…มีสาระมากครับ

ทำไมต้อง Zoom?

คำตอบ คือ เพื่อให้ pane มีขนาดใหญ่ขึ้น ครับ ซึ่งปกติเวลาเปิด tmux แล้วแบ่ง panes ย่อยๆ ออกเป็น 4 5 6 7 หรือเท่าไหร่ก็แล้วแต่ (จริงๆ ควรแบ่งแค่พอเหมาะ อย่าเยอะ!!!) ขนาดของ panes มันเล็กลงๆ เรื่อยๆ ฉะนั้น ยิ่งเราแบ่ง panes เยอะยิ่งทำให้มองเห็นรายละเอียดของแต่ละ panes น้อยลง (เพราะแต่ละ panes จะถูกบีบด้วยขนาดของ Window) ตามภาพที่ 1

Figure 1: tmux with multiple panes

อยาก Zoom ต้องทำยังไง?

ทำได้ง่ายๆ ด้วยการกด “Prefix + z” (Ctrl + b แล้วตามด้วย z) จากนั้น tmux จะทำการ zoomed pane ที่ active อยู่ ณ ขนะนั้น ให้มีขนาดเท่ากับ window พร้อมกับการแปะสัญลักษณ์ “Z” ไว้ที่ Status Bar ให้ด้วย ตามภาพที่ 2

Figure 2: tmux zoomed pane

มี Zoomed ก็ต้องมี Unzoomed!

วิธีการ unzoomed ก็แค่กด “Prefix + z” อีกครั้ง tmux ก็จะทำการ unzoomed กลับมาสภาพเดิม ตามภาพที่ 3 ครับ

Figure 3: tmux unzoomed pane

Pain ที่ดีควรมีแค่ 6!!!

Photo credit: Deviantart.net

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade