summaryrefslogtreecommitdiff
path: root/gemfeed/atom.xml
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-06-23 23:07:19 +0300
committerPaul Buetow <paul@buetow.org>2024-06-23 23:07:19 +0300
commit0386081be25df138e83175606ef3f49af292aef1 (patch)
tree030809591f5c407efb2136c12de8fbeba5b99d08 /gemfeed/atom.xml
parent068b0c4d1fd212aa5cf1273b1d1ae39674634b07 (diff)
Update content for gemtext
Diffstat (limited to 'gemfeed/atom.xml')
-rw-r--r--gemfeed/atom.xml52
1 files changed, 46 insertions, 6 deletions
diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml
index 3c5a9a1d..5b7691ce 100644
--- a/gemfeed/atom.xml
+++ b/gemfeed/atom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
- <updated>2024-06-23T22:41:59+03:00</updated>
+ <updated>2024-06-23T23:06:46+03:00</updated>
<title>foo.zone feed</title>
<subtitle>To be in the .zone!</subtitle>
<link href="gemini://foo.zone/gemfeed/atom.xml" rel="self" />
@@ -15,11 +15,13 @@
<name>Paul Buetow aka snonux</name>
<email>paul@dev.buetow.org</email>
</author>
- <summary>Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities:</summary>
+ <summary>Table of contents</summary>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<h1 style='display: inline' id='Terminalmultiplexingwithtmux'>Terminal multiplexing with <span class='inlinecode'>tmux</span></h1><br />
<br />
+<span class='quote'>Published at 2024-06-23T22:41:59+03:00</span><br />
+<br />
<pre>
\\\\\\\
\\\\\\\\\\\\
@@ -43,6 +45,29 @@ _____________|&#39;,&#39; ///_/-------------/ |
</pre>
<br />
+<pre>
+Table of contents
+=================
+
+Terminal multiplexing with `tmux`
+ Introduction
+ Shell aliases
+ The `tn` alias - Creating a new session
+ Cleaning up default sessions automatically
+ Renaming sessions
+ The `ta` alias - Attaching to a session
+ The `tr` alias - For a nested remote session
+ Change of the Tmux prefix for better nesting
+ The `ts` alias - Searching sessions with fuzzy finder
+ The `tssh` alias - Cluster SSH replacement
+ The `tmux::tssh_from_argument` helper
+ The `tmux::tssh_from_file` helper
+ `tssh` examples
+ Common Tmux commands I use in `tssh`
+ Copy and paste workflow
+ Tmux configurations
+</pre>
+<br />
<h2 style='display: inline' id='Introduction'>Introduction</h2><br />
<br />
<span>Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities:</span><br />
@@ -197,7 +222,7 @@ set-option -g prefix C-g
<br />
<span>This way, when I want to rename the remote Tmux session, I have to use <span class='inlinecode'>Ctrl-g $</span>, and when I want to rename the local Tmux session, I still have to use <span class='inlinecode'>Ctrl-b $</span>. In my case, I have this deployed to all remote servers through a configuration management system (out of scope for this blog post).</span><br />
<br />
-<span>There might also be another way around this (without reconfiguring the prefix key), but that is cumbersome, as far as I remember. </span><br />
+<span>There might also be another way around this (without reconfiguring the prefix key), but that is cumbersome to use, as far as I remember. </span><br />
<br />
<h2 style='display: inline' id='ThetsaliasSearchingsessionswithfuzzyfinder'>The <span class='inlinecode'>ts</span> alias - Searching sessions with fuzzy finder</h2><br />
<br />
@@ -236,7 +261,7 @@ http://www.gnu.org/software/src-highlite -->
<li>...the first argument will be the session name (see <span class='inlinecode'>tmux::tssh_from_argument</span> helper function), and all remaining arguments will be server hostnames/FQDNs to connect to simultaneously.</li>
<li>...or, the first argument is a file name, and the file contains a list of hostnames/FQDNs (see <span class='inlinecode'>tmux::ssh_from_file</span> helper function)</li>
</ul><br />
-<span>This is the helper function definition:</span><br />
+<span>This is the function definition behind the <span class='inlinecode'>tssh</span> alias:</span><br />
<span> </span><br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
@@ -341,6 +366,13 @@ $ tssh manyservers.txt
<br />
<span>Once I have identified the terminal text to be copied, I enter visual select mode with <span class='inlinecode'>v</span>, highlight all the text to be copied (using arrow keys or Vi motions), and press <span class='inlinecode'>y</span> to yank it (sorry if this all sounds a bit complicated, but Vim/NeoVim users will know this, as it is pretty much how you do it there as well).</span><br />
<br />
+<span>For <span class='inlinecode'>v</span> and <span class='inlinecode'>y</span> to work, the following has to be added to the Tmux configuration file: </span><br />
+<br />
+<pre>
+bind-key -T copy-mode-vi &#39;v&#39; send -X begin-selection
+bind-key -T copy-mode-vi &#39;y&#39; send -X copy-selection-and-cancel
+</pre>
+<br />
<span>Once the text is yanked, I switch to another Tmux window or session where, for example, a text editor is running and paste the yanked text from Tmux into the editor with <span class='inlinecode'>prefix-key ]</span>. Note that when pasting into a modal text editor like Vi or Helix, you would first need to enter insert mode before <span class='inlinecode'>prefix-key ]</span> would paste anything.</span><br />
<br />
<h2 style='display: inline' id='Tmuxconfigurations'>Tmux configurations</h2><br />
@@ -355,8 +387,6 @@ set-option -g history-limit 100000
set-option -g status-bg &#39;#444444&#39;
set-option -g status-fg &#39;#ffa500&#39;
set-option -s escape-time 0
-set-window-option -g mode-keys vi
-
</pre>
<br />
<span>There&#39;s yet to be much magic happening here. I source a <span class='inlinecode'>tmux.local.conf</span>, which I sometimes use to override the default configuration that comes from the configuration management system. But it is mostly just an empty file, so it doesn&#39;t throw any errors on Tmux startup when I don&#39;t use it.</span><br />
@@ -365,8 +395,18 @@ set-window-option -g mode-keys vi
<br />
<span>Besides changing some colours (personal taste), I also set <span class='inlinecode'>escape-time</span> to <span class='inlinecode'>0</span>, which is just a workaround. Otherwise, my Helix text editor&#39;s <span class='inlinecode'>ESC</span> key would take ages to trigger within Tmux. I am trying to remember the gory details. You can leave it out; if everything works fine for you, leave it out.</span><br />
<br />
+<span>The next lines in the configuration file are:</span><br />
+<br />
+<pre>
+set-window-option -g mode-keys vi
+bind-key -T copy-mode-vi &#39;v&#39; send -X begin-selection
+bind-key -T copy-mode-vi &#39;y&#39; send -X copy-selection-and-cancel
+</pre>
+<br />
<span>I navigate within Tmux using Vi keybindings, so the <span class='inlinecode'>mode-keys</span> is set to <span class='inlinecode'>vi</span>. I use the Helix modal text editor, which is close enough to Vi bindings for simple navigation to feel "native" to me. (By the way, I have been a long-time Vim and NeoVim user, but I eventually switched to Helix. It&#39;s off-topic here, but it may be worth another blog post once.)</span><br />
<br />
+<span>The two <span class='inlinecode'>bind-key</span> commands make it so that I can use <span class='inlinecode'>v</span> and <span class='inlinecode'>y</span> in copy mode, which feels more Vi-like (as already discussed earlier in this post).</span><br />
+<br />
<span>The next set of lines in the configuration file are:</span><br />
<br />
<pre>