diff options
author | Akshay <[email protected]> | 2024-11-27 23:01:48 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2024-11-27 23:01:48 +0000 |
commit | 92a1fd5c5ee1fb0b4079128a0b7c6a1d78a2399d (patch) | |
tree | 3d1b106db2ca2824d4afffdc433a084e14675772 | |
parent | 9828c78d95f2195cd8e1db04887072cd5f48005b (diff) |
new post: OSC-52
-rw-r--r-- | docs/index.html | 24 | ||||
-rw-r--r-- | docs/index.xml | 53 | ||||
-rw-r--r-- | docs/posts/OSC-52/index.html | 119 | ||||
-rw-r--r-- | docs/posts/auto-currying_rust_functions/index.html | 2 | ||||
-rw-r--r-- | docs/posts/bash_harder_with_vim/index.html | 2 | ||||
-rw-r--r-- | docs/posts/call_to_ARMs/index.html | 2 | ||||
-rw-r--r-- | docs/posts/color_conundrum/index.html | 2 | ||||
-rw-r--r-- | docs/posts/font_size_fallacies/index.html | 2 | ||||
-rw-r--r-- | docs/posts/index.html | 43 | ||||
-rw-r--r-- | docs/posts/introducing_tablespoon/index.html | 2 | ||||
-rw-r--r-- | docs/posts/my_setup/index.html | 2 | ||||
-rw-r--r-- | docs/posts/pixel_art_in_GIMP/index.html | 2 | ||||
-rw-r--r-- | docs/posts/plain_text_journaling/index.html | 2 | ||||
-rw-r--r-- | docs/posts/rapid_refactoring_with_vim/index.html | 2 | ||||
-rw-r--r-- | docs/posts/static_sites_with_bash/index.html | 2 | ||||
-rw-r--r-- | docs/posts/termux_tandem/index.html | 2 | ||||
-rw-r--r-- | docs/posts/turing_complete_type_systems/index.html | 2 | ||||
-rw-r--r-- | posts/OSC-52.md | 66 | ||||
-rwxr-xr-x | recover.sh | 2 |
19 files changed, 295 insertions, 38 deletions
diff --git a/docs/index.html b/docs/index.html index 2d9b619..a834038 100644 --- a/docs/index.html +++ b/docs/index.html | |||
@@ -39,15 +39,15 @@ | |||
39 | <tr> | 39 | <tr> |
40 | <td class=table-post> | 40 | <td class=table-post> |
41 | <div class="date"> | 41 | <div class="date"> |
42 | 01/08 — 2024 | 42 | 28/11 — 2024 |
43 | </div> | 43 | </div> |
44 | <a href="/posts/introducing_tablespoon" class="post-link"> | 44 | <a href="/posts/OSC-52" class="post-link"> |
45 | <span class="post-link">Introducing Tablespoon</span> | 45 | <span class="post-link">OSC-52</span> |
46 | </a> | 46 | </a> |
47 | </td> | 47 | </td> |
48 | <td class=table-stats> | 48 | <td class=table-stats> |
49 | <span class="stats-number"> | 49 | <span class="stats-number"> |
50 | 4.5 | 50 | 1.9 |
51 | </span> | 51 | </span> |
52 | <span class=stats-unit>min</span> | 52 | <span class=stats-unit>min</span> |
53 | </td> | 53 | </td> |
@@ -56,15 +56,15 @@ | |||
56 | <tr> | 56 | <tr> |
57 | <td class=table-post> | 57 | <td class=table-post> |
58 | <div class="date"> | 58 | <div class="date"> |
59 | 29/05 — 2024 | 59 | 02/08 — 2024 |
60 | </div> | 60 | </div> |
61 | <a href="/posts/snip_snap" class="post-link"> | 61 | <a href="/posts/introducing_tablespoon" class="post-link"> |
62 | <span class="post-link">Snip Snap</span> | 62 | <span class="post-link">Introducing Tablespoon</span> |
63 | </a> | 63 | </a> |
64 | </td> | 64 | </td> |
65 | <td class=table-stats> | 65 | <td class=table-stats> |
66 | <span class="stats-number"> | 66 | <span class="stats-number"> |
67 | 2.1 | 67 | 4.5 |
68 | </span> | 68 | </span> |
69 | <span class=stats-unit>min</span> | 69 | <span class=stats-unit>min</span> |
70 | </td> | 70 | </td> |
@@ -73,15 +73,15 @@ | |||
73 | <tr> | 73 | <tr> |
74 | <td class=table-post> | 74 | <td class=table-post> |
75 | <div class="date"> | 75 | <div class="date"> |
76 | 18/06 — 2023 | 76 | 29/05 — 2024 |
77 | </div> | 77 | </div> |
78 | <a href="/posts/plain_text_journaling" class="post-link"> | 78 | <a href="/posts/snip_snap" class="post-link"> |
79 | <span class="post-link">Plain Text Journaling</span> | 79 | <span class="post-link">Snip Snap</span> |
80 | </a> | 80 | </a> |
81 | </td> | 81 | </td> |
82 | <td class=table-stats> | 82 | <td class=table-stats> |
83 | <span class="stats-number"> | 83 | <span class="stats-number"> |
84 | 8.9 | 84 | 2.1 |
85 | </span> | 85 | </span> |
86 | <span class=stats-unit>min</span> | 86 | <span class=stats-unit>min</span> |
87 | </td> | 87 | </td> |
diff --git a/docs/index.xml b/docs/index.xml index eec76ca..f8b2aeb 100644 --- a/docs/index.xml +++ b/docs/index.xml | |||
@@ -12,6 +12,59 @@ | |||
12 | <language>en-us</language> | 12 | <language>en-us</language> |
13 | <copyright>Creative Commons BY-NC-SA 4.0</copyright> | 13 | <copyright>Creative Commons BY-NC-SA 4.0</copyright> |
14 | <item> | 14 | <item> |
15 | <title>OSC-52</title> | ||
16 | <description><p>I use <code>ssh</code> a lot. Copying text from the remote machine to | ||
17 | the host machine always sucked. But OSC-52 makes that easy.</p> | ||
18 | <p>OSC-52 is an ANSI escape sequence to write text to the terminal | ||
19 | emulator. The terminal emulator, if it understands what is going on, | ||
20 | will in turn write this text to the system clipboard.</p> | ||
21 | <p>What this means is some <code>printf</code> magic can send text to | ||
22 | your clipboard. I store this one-liner in a script called | ||
23 | <code>oclip</code>:</p> | ||
24 | <div class="sourceCode" id="cb1"><pre | ||
25 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="bu">printf</span> <span class="st">&quot;\033]52;c;%s\007&quot;</span> <span class="st">&quot;</span><span class="va">$(</span><span class="fu">base64</span> <span class="op">&lt;&amp;</span><span class="dv">0</span><span class="va">)</span><span class="st">&quot;</span></span></code></pre></div> | ||
26 | <p>and I run it with:</p> | ||
27 | <div class="sourceCode" id="cb2"><pre | ||
28 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">remote</span> $ cat some_file.txt <span class="kw">|</span> <span class="ex">oclip</span></span> | ||
29 | <span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span> | ||
30 | <span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="co"># some_file.txt&#39;s contents are now the host&#39;s clipboard</span></span></code></pre></div> | ||
31 | <h3 id="the-catch">The catch</h3> | ||
32 | <p>Your terminal emulator must support OSC-52, <code>alacritty</code> | ||
33 | and <code>termux</code> seem to support this out of the box. In | ||
34 | <code>st</code>, OSC-52 works with this change to | ||
35 | <code>config.h</code>:</p> | ||
36 | <pre><code>int allowwindowops = 1;</code></pre> | ||
37 | <p>If you are using <code>tmux</code>, you need to flip this switch | ||
38 | on:</p> | ||
39 | <pre><code>set -s set-clipboard on</code></pre> | ||
40 | <p>If you are inside <code>nvim</code>, it may work as expected as long | ||
41 | as <code>$SSH_TTY</code> is set. I sometimes physically start a session, | ||
42 | and <code>ssh</code> into the same session later from another machine, | ||
43 | and <code>$SSH_TTY</code> remains unset, so I force OSC-52 in | ||
44 | <code>nvim</code> at all times (see <a | ||
45 | href="https://neovim.io/doc/user/provider.html#clipboard-osc52">nvimdoc</a>):</p> | ||
46 | <div class="sourceCode" id="cb5"><pre | ||
47 | class="sourceCode lua"><code class="sourceCode lua"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="va">vim</span><span class="op">.</span><span class="va">g</span><span class="op">.</span><span class="va">clipboard</span> <span class="op">=</span> <span class="op">{</span></span> | ||
48 | <span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="va">name</span> <span class="op">=</span> <span class="st">&#39;OSC 52&#39;</span><span class="op">,</span></span> | ||
49 | <span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="va">copy</span> <span class="op">=</span> <span class="op">{</span></span> | ||
50 | <span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> <span class="op">[</span><span class="st">&#39;+&#39;</span><span class="op">]</span> <span class="op">=</span> <span class="fu">require</span><span class="op">(</span><span class="st">&#39;vim.ui.clipboard.osc52&#39;</span><span class="op">).</span>copy<span class="op">(</span><span class="st">&#39;+&#39;</span><span class="op">),</span></span> | ||
51 | <span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a> <span class="op">[</span><span class="st">&#39;*&#39;</span><span class="op">]</span> <span class="op">=</span> <span class="fu">require</span><span class="op">(</span><span class="st">&#39;vim.ui.clipboard.osc52&#39;</span><span class="op">).</span>copy<span class="op">(</span><span class="st">&#39;*&#39;</span><span class="op">),</span></span> | ||
52 | <span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a> <span class="op">},</span></span> | ||
53 | <span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a> <span class="va">paste</span> <span class="op">=</span> <span class="op">{</span></span> | ||
54 | <span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a> <span class="op">[</span><span class="st">&#39;+&#39;</span><span class="op">]</span> <span class="op">=</span> <span class="fu">require</span><span class="op">(</span><span class="st">&#39;vim.ui.clipboard.osc52&#39;</span><span class="op">).</span>paste<span class="op">(</span><span class="st">&#39;+&#39;</span><span class="op">),</span></span> | ||
55 | <span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a> <span class="op">[</span><span class="st">&#39;*&#39;</span><span class="op">]</span> <span class="op">=</span> <span class="fu">require</span><span class="op">(</span><span class="st">&#39;vim.ui.clipboard.osc52&#39;</span><span class="op">).</span>paste<span class="op">(</span><span class="st">&#39;*&#39;</span><span class="op">),</span></span> | ||
56 | <span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a> <span class="op">},</span></span> | ||
57 | <span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> | ||
58 | <p>If you are inside <code>nvim</code> inside <code>tmux</code> inside | ||
59 | an <code>ssh</code> session inside <code>st</code>, you neeed all of the | ||
60 | above tweaks. <code>nvim</code> will pass the contents around to | ||
61 | <code>tmux</code>, which in turn will pass the contents to | ||
62 | <code>st</code>, which should pass it to your system clipboard.</p></description> | ||
63 | <link>https://peppe.rs/posts/OSC-52/</link> | ||
64 | <pubDate>Wed, 27 Nov 2024 22:56:00 +0000</pubDate> | ||
65 | <guid>https://peppe.rs/posts/OSC-52/</guid> | ||
66 | </item> | ||
67 | <item> | ||
15 | <title>Introducing Tablespoon</title> | 68 | <title>Introducing Tablespoon</title> |
16 | <description><p><a href="https://git.peppe.rs/languages/tbsp">tbsp</a> (tree-based | 69 | <description><p><a href="https://git.peppe.rs/languages/tbsp">tbsp</a> (tree-based |
17 | source-processing language) is an awk-like language that operates on | 70 | source-processing language) is an awk-like language that operates on |
diff --git a/docs/posts/OSC-52/index.html b/docs/posts/OSC-52/index.html new file mode 100644 index 0000000..6c87fef --- /dev/null +++ b/docs/posts/OSC-52/index.html | |||
@@ -0,0 +1,119 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <link rel="stylesheet" href="/style.css"> | ||
5 | <link rel="stylesheet" href="/syntax.css"> | ||
6 | <meta charset="UTF-8"> | ||
7 | <meta name="viewport" content="initial-scale=1"> | ||
8 | <meta content="#ffffff" name="theme-color"> | ||
9 | <meta name="HandheldFriendly" content="true"> | ||
10 | <meta property="og:title" content="OSC-52"> | ||
11 | <meta property="og:type" content="website"> | ||
12 | <meta property="og:description" content="a static site {for, by, about} me "> | ||
13 | <meta property="og:url" content="https://peppe.rs"> | ||
14 | <link rel="icon" type="image/x-icon" href="/favicon.png"> | ||
15 | <title>OSC-52 · peppe.rs</title> | ||
16 | <body> | ||
17 | <div class="posts"> | ||
18 | <div class="post"> | ||
19 | <a href="/" class="post-end-link">Home</a> | ||
20 | <span>/</span> | ||
21 | <a href="/posts" class="post-end-link">Posts</a> | ||
22 | <span>/</span> | ||
23 | <a class="post-end-link">OSC-52</a> | ||
24 | <a class="stats post-end-link" href="https://git.peppe.rs/web/site/plain/posts/OSC-52.md | ||
25 | ">View Raw</a> | ||
26 | <div class="separator"></div> | ||
27 | <div class="date"> | ||
28 | 28/11 — 2024 | ||
29 | <div class="stats"> | ||
30 | <span class="stats-number"> | ||
31 | 26.37 | ||
32 | </span> | ||
33 | <span class="stats-unit">cm</span> | ||
34 |   | ||
35 | <span class="stats-number"> | ||
36 | 1.9 | ||
37 | </span> | ||
38 | <span class="stats-unit">min</span> | ||
39 | </div> | ||
40 | </div> | ||
41 | <h1> | ||
42 | OSC-52 | ||
43 | </h1> | ||
44 | <div class="post-text"> | ||
45 | <p>I use <code>ssh</code> a lot. Copying text from the remote machine to | ||
46 | the host machine always sucked. But OSC-52 makes that easy.</p> | ||
47 | <p>OSC-52 is an ANSI escape sequence to write text to the terminal | ||
48 | emulator. The terminal emulator, if it understands what is going on, | ||
49 | will in turn write this text to the system clipboard.</p> | ||
50 | <p>What this means is some <code>printf</code> magic can send text to | ||
51 | your clipboard. I store this one-liner in a script called | ||
52 | <code>oclip</code>:</p> | ||
53 | <div class="sourceCode" id="cb1"><pre | ||
54 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="bu">printf</span> <span class="st">"\033]52;c;%s\007"</span> <span class="st">"</span><span class="va">$(</span><span class="fu">base64</span> <span class="op"><&</span><span class="dv">0</span><span class="va">)</span><span class="st">"</span></span></code></pre></div> | ||
55 | <p>and I run it with:</p> | ||
56 | <div class="sourceCode" id="cb2"><pre | ||
57 | class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">remote</span> $ cat some_file.txt <span class="kw">|</span> <span class="ex">oclip</span></span> | ||
58 | <span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span> | ||
59 | <span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="co"># some_file.txt's contents are now the host's clipboard</span></span></code></pre></div> | ||
60 | <h3 id="the-catch">The catch</h3> | ||
61 | <p>Your terminal emulator must support OSC-52, <code>alacritty</code> | ||
62 | and <code>termux</code> seem to support this out of the box. In | ||
63 | <code>st</code>, OSC-52 works with this change to | ||
64 | <code>config.h</code>:</p> | ||
65 | <pre><code>int allowwindowops = 1;</code></pre> | ||
66 | <p>If you are using <code>tmux</code>, you need to flip this switch | ||
67 | on:</p> | ||
68 | <pre><code>set -s set-clipboard on</code></pre> | ||
69 | <p>If you are inside <code>nvim</code>, it may work as expected as long | ||
70 | as <code>$SSH_TTY</code> is set. I sometimes physically start a session, | ||
71 | and <code>ssh</code> into the same session later from another machine, | ||
72 | and <code>$SSH_TTY</code> remains unset, so I force OSC-52 in | ||
73 | <code>nvim</code> at all times (see <a | ||
74 | href="https://neovim.io/doc/user/provider.html#clipboard-osc52">nvimdoc</a>):</p> | ||
75 | <div class="sourceCode" id="cb5"><pre | ||
76 | class="sourceCode lua"><code class="sourceCode lua"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="va">vim</span><span class="op">.</span><span class="va">g</span><span class="op">.</span><span class="va">clipboard</span> <span class="op">=</span> <span class="op">{</span></span> | ||
77 | <span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="va">name</span> <span class="op">=</span> <span class="st">'OSC 52'</span><span class="op">,</span></span> | ||
78 | <span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="va">copy</span> <span class="op">=</span> <span class="op">{</span></span> | ||
79 | <span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> <span class="op">[</span><span class="st">'+'</span><span class="op">]</span> <span class="op">=</span> <span class="fu">require</span><span class="op">(</span><span class="st">'vim.ui.clipboard.osc52'</span><span class="op">).</span>copy<span class="op">(</span><span class="st">'+'</span><span class="op">),</span></span> | ||
80 | <span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a> <span class="op">[</span><span class="st">'*'</span><span class="op">]</span> <span class="op">=</span> <span class="fu">require</span><span class="op">(</span><span class="st">'vim.ui.clipboard.osc52'</span><span class="op">).</span>copy<span class="op">(</span><span class="st">'*'</span><span class="op">),</span></span> | ||
81 | <span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a> <span class="op">},</span></span> | ||
82 | <span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a> <span class="va">paste</span> <span class="op">=</span> <span class="op">{</span></span> | ||
83 | <span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a> <span class="op">[</span><span class="st">'+'</span><span class="op">]</span> <span class="op">=</span> <span class="fu">require</span><span class="op">(</span><span class="st">'vim.ui.clipboard.osc52'</span><span class="op">).</span>paste<span class="op">(</span><span class="st">'+'</span><span class="op">),</span></span> | ||
84 | <span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a> <span class="op">[</span><span class="st">'*'</span><span class="op">]</span> <span class="op">=</span> <span class="fu">require</span><span class="op">(</span><span class="st">'vim.ui.clipboard.osc52'</span><span class="op">).</span>paste<span class="op">(</span><span class="st">'*'</span><span class="op">),</span></span> | ||
85 | <span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a> <span class="op">},</span></span> | ||
86 | <span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> | ||
87 | <p>If you are inside <code>nvim</code> inside <code>tmux</code> inside | ||
88 | an <code>ssh</code> session inside <code>st</code>, you neeed all of the | ||
89 | above tweaks. <code>nvim</code> will pass the contents around to | ||
90 | <code>tmux</code>, which in turn will pass the contents to | ||
91 | <code>st</code>, which should pass it to your system clipboard.</p> | ||
92 | |||
93 | </div> | ||
94 | |||
95 | <div class="intro"> | ||
96 | Hi. | ||
97 | <div class="hot-links"> | ||
98 | <a href="/index.xml" class="feed-button">Subscribe</a> | ||
99 | </div> | ||
100 | <p>I'm Akshay, programmer and pixel-artist. | ||
101 | I write <a href="https://git.peppe.rs">open-source stuff</a>. | ||
102 | I also design fonts: | ||
103 | <a href="https://git.peppe.rs/fonts/scientifica/about">scientifica</a>, | ||
104 | <a href="https://git.peppe.rs/fonts/curie/about">curie</a>. | ||
105 | </p> | ||
106 | <p>Reach out at [email protected].</p> | ||
107 | </div> | ||
108 | |||
109 | <a href="/" class="post-end-link">Home</a> | ||
110 | <span>/</span> | ||
111 | <a href="/posts" class="post-end-link">Posts</a> | ||
112 | <span>/</span> | ||
113 | <a class="post-end-link">OSC-52</a> | ||
114 | <a class="stats post-end-link" href="https://git.peppe.rs/web/site/plain/posts/OSC-52.md | ||
115 | ">View Raw</a> | ||
116 | </div> | ||
117 | </div> | ||
118 | </body> | ||
119 | </html> | ||
diff --git a/docs/posts/auto-currying_rust_functions/index.html b/docs/posts/auto-currying_rust_functions/index.html index c06b13f..9ea7246 100644 --- a/docs/posts/auto-currying_rust_functions/index.html +++ b/docs/posts/auto-currying_rust_functions/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 08/05 — 2020 | 28 | 09/05 — 2020 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 356.44 | 31 | 356.44 |
diff --git a/docs/posts/bash_harder_with_vim/index.html b/docs/posts/bash_harder_with_vim/index.html index 6104163..7d3c869 100644 --- a/docs/posts/bash_harder_with_vim/index.html +++ b/docs/posts/bash_harder_with_vim/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 30/07 — 2019 | 28 | 31/07 — 2019 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 24.38 | 31 | 24.38 |
diff --git a/docs/posts/call_to_ARMs/index.html b/docs/posts/call_to_ARMs/index.html index 71b5397..f5b92f7 100644 --- a/docs/posts/call_to_ARMs/index.html +++ b/docs/posts/call_to_ARMs/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 07/02 — 2020 | 28 | 08/02 — 2020 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 33.57 | 31 | 33.57 |
diff --git a/docs/posts/color_conundrum/index.html b/docs/posts/color_conundrum/index.html index 87bc495..a98741a 100644 --- a/docs/posts/color_conundrum/index.html +++ b/docs/posts/color_conundrum/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 30/12 — 2019 | 28 | 31/12 — 2019 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 14.39 | 31 | 14.39 |
diff --git a/docs/posts/font_size_fallacies/index.html b/docs/posts/font_size_fallacies/index.html index 871a536..5cf8485 100644 --- a/docs/posts/font_size_fallacies/index.html +++ b/docs/posts/font_size_fallacies/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 16/03 — 2020 | 28 | 17/03 — 2020 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 32.37 | 31 | 32.37 |
diff --git a/docs/posts/index.html b/docs/posts/index.html index a8d321c..f70098b 100644 --- a/docs/posts/index.html +++ b/docs/posts/index.html | |||
@@ -27,7 +27,24 @@ | |||
27 | <tr> | 27 | <tr> |
28 | <td class=table-post> | 28 | <td class=table-post> |
29 | <div class="date"> | 29 | <div class="date"> |
30 | 01/08 — 2024 | 30 | 28/11 — 2024 |
31 | </div> | ||
32 | <a href="/posts/OSC-52" class="post-link"> | ||
33 | <span class="post-link">OSC-52</span> | ||
34 | </a> | ||
35 | </td> | ||
36 | <td class=table-stats> | ||
37 | <span class="stats-number"> | ||
38 | 1.9 | ||
39 | </span> | ||
40 | <span class=stats-unit>min</span> | ||
41 | </td> | ||
42 | </tr> | ||
43 | |||
44 | <tr> | ||
45 | <td class=table-post> | ||
46 | <div class="date"> | ||
47 | 02/08 — 2024 | ||
31 | </div> | 48 | </div> |
32 | <a href="/posts/introducing_tablespoon" class="post-link"> | 49 | <a href="/posts/introducing_tablespoon" class="post-link"> |
33 | <span class="post-link">Introducing Tablespoon</span> | 50 | <span class="post-link">Introducing Tablespoon</span> |
@@ -61,7 +78,7 @@ | |||
61 | <tr> | 78 | <tr> |
62 | <td class=table-post> | 79 | <td class=table-post> |
63 | <div class="date"> | 80 | <div class="date"> |
64 | 18/06 — 2023 | 81 | 19/06 — 2023 |
65 | </div> | 82 | </div> |
66 | <a href="/posts/plain_text_journaling" class="post-link"> | 83 | <a href="/posts/plain_text_journaling" class="post-link"> |
67 | <span class="post-link">Plain Text Journaling</span> | 84 | <span class="post-link">Plain Text Journaling</span> |
@@ -248,7 +265,7 @@ | |||
248 | <tr> | 265 | <tr> |
249 | <td class=table-post> | 266 | <td class=table-post> |
250 | <div class="date"> | 267 | <div class="date"> |
251 | 17/06 — 2020 | 268 | 18/06 — 2020 |
252 | </div> | 269 | </div> |
253 | <a href="/posts/turing_complete_type_systems" class="post-link"> | 270 | <a href="/posts/turing_complete_type_systems" class="post-link"> |
254 | <span class="post-link">Turing Complete Type Systems</span> | 271 | <span class="post-link">Turing Complete Type Systems</span> |
@@ -265,7 +282,7 @@ | |||
265 | <tr> | 282 | <tr> |
266 | <td class=table-post> | 283 | <td class=table-post> |
267 | <div class="date"> | 284 | <div class="date"> |
268 | 08/05 — 2020 | 285 | 09/05 — 2020 |
269 | </div> | 286 | </div> |
270 | <a href="/posts/auto-currying_rust_functions" class="post-link"> | 287 | <a href="/posts/auto-currying_rust_functions" class="post-link"> |
271 | <span class="post-link">Auto-currying Rust Functions</span> | 288 | <span class="post-link">Auto-currying Rust Functions</span> |
@@ -282,7 +299,7 @@ | |||
282 | <tr> | 299 | <tr> |
283 | <td class=table-post> | 300 | <td class=table-post> |
284 | <div class="date"> | 301 | <div class="date"> |
285 | 08/04 — 2020 | 302 | 09/04 — 2020 |
286 | </div> | 303 | </div> |
287 | <a href="/posts/pixel_art_in_GIMP" class="post-link"> | 304 | <a href="/posts/pixel_art_in_GIMP" class="post-link"> |
288 | <span class="post-link">Pixel Art In GIMP</span> | 305 | <span class="post-link">Pixel Art In GIMP</span> |
@@ -299,7 +316,7 @@ | |||
299 | <tr> | 316 | <tr> |
300 | <td class=table-post> | 317 | <td class=table-post> |
301 | <div class="date"> | 318 | <div class="date"> |
302 | 31/03 — 2020 | 319 | 01/04 — 2020 |
303 | </div> | 320 | </div> |
304 | <a href="/posts/rapid_refactoring_with_vim" class="post-link"> | 321 | <a href="/posts/rapid_refactoring_with_vim" class="post-link"> |
305 | <span class="post-link">Rapid Refactoring With Vim</span> | 322 | <span class="post-link">Rapid Refactoring With Vim</span> |
@@ -316,7 +333,7 @@ | |||
316 | <tr> | 333 | <tr> |
317 | <td class=table-post> | 334 | <td class=table-post> |
318 | <div class="date"> | 335 | <div class="date"> |
319 | 16/03 — 2020 | 336 | 17/03 — 2020 |
320 | </div> | 337 | </div> |
321 | <a href="/posts/font_size_fallacies" class="post-link"> | 338 | <a href="/posts/font_size_fallacies" class="post-link"> |
322 | <span class="post-link">Font Size Fallacies</span> | 339 | <span class="post-link">Font Size Fallacies</span> |
@@ -333,7 +350,7 @@ | |||
333 | <tr> | 350 | <tr> |
334 | <td class=table-post> | 351 | <td class=table-post> |
335 | <div class="date"> | 352 | <div class="date"> |
336 | 07/03 — 2020 | 353 | 08/03 — 2020 |
337 | </div> | 354 | </div> |
338 | <a href="/posts/termux_tandem" class="post-link"> | 355 | <a href="/posts/termux_tandem" class="post-link"> |
339 | <span class="post-link">Termux Tandem</span> | 356 | <span class="post-link">Termux Tandem</span> |
@@ -350,7 +367,7 @@ | |||
350 | <tr> | 367 | <tr> |
351 | <td class=table-post> | 368 | <td class=table-post> |
352 | <div class="date"> | 369 | <div class="date"> |
353 | 07/02 — 2020 | 370 | 08/02 — 2020 |
354 | </div> | 371 | </div> |
355 | <a href="/posts/call_to_ARMs" class="post-link"> | 372 | <a href="/posts/call_to_ARMs" class="post-link"> |
356 | <span class="post-link">Call To ARMs</span> | 373 | <span class="post-link">Call To ARMs</span> |
@@ -367,7 +384,7 @@ | |||
367 | <tr> | 384 | <tr> |
368 | <td class=table-post> | 385 | <td class=table-post> |
369 | <div class="date"> | 386 | <div class="date"> |
370 | 30/12 — 2019 | 387 | 31/12 — 2019 |
371 | </div> | 388 | </div> |
372 | <a href="/posts/color_conundrum" class="post-link"> | 389 | <a href="/posts/color_conundrum" class="post-link"> |
373 | <span class="post-link">Color Conundrum</span> | 390 | <span class="post-link">Color Conundrum</span> |
@@ -384,7 +401,7 @@ | |||
384 | <tr> | 401 | <tr> |
385 | <td class=table-post> | 402 | <td class=table-post> |
386 | <div class="date"> | 403 | <div class="date"> |
387 | 22/11 — 2019 | 404 | 23/11 — 2019 |
388 | </div> | 405 | </div> |
389 | <a href="/posts/static_sites_with_bash" class="post-link"> | 406 | <a href="/posts/static_sites_with_bash" class="post-link"> |
390 | <span class="post-link">Static Sites With Bash</span> | 407 | <span class="post-link">Static Sites With Bash</span> |
@@ -401,7 +418,7 @@ | |||
401 | <tr> | 418 | <tr> |
402 | <td class=table-post> | 419 | <td class=table-post> |
403 | <div class="date"> | 420 | <div class="date"> |
404 | 06/11 — 2019 | 421 | 07/11 — 2019 |
405 | </div> | 422 | </div> |
406 | <a href="/posts/my_setup" class="post-link"> | 423 | <a href="/posts/my_setup" class="post-link"> |
407 | <span class="post-link">My Setup</span> | 424 | <span class="post-link">My Setup</span> |
@@ -469,7 +486,7 @@ | |||
469 | <tr> | 486 | <tr> |
470 | <td class=table-post> | 487 | <td class=table-post> |
471 | <div class="date"> | 488 | <div class="date"> |
472 | 30/07 — 2019 | 489 | 31/07 — 2019 |
473 | </div> | 490 | </div> |
474 | <a href="/posts/bash_harder_with_vim" class="post-link"> | 491 | <a href="/posts/bash_harder_with_vim" class="post-link"> |
475 | <span class="post-link">Bash Harder With Vim</span> | 492 | <span class="post-link">Bash Harder With Vim</span> |
diff --git a/docs/posts/introducing_tablespoon/index.html b/docs/posts/introducing_tablespoon/index.html index a6f6ef2..c097cfa 100644 --- a/docs/posts/introducing_tablespoon/index.html +++ b/docs/posts/introducing_tablespoon/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 01/08 — 2024 | 28 | 02/08 — 2024 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 72.33 | 31 | 72.33 |
diff --git a/docs/posts/my_setup/index.html b/docs/posts/my_setup/index.html index 9844d52..a5cdef5 100644 --- a/docs/posts/my_setup/index.html +++ b/docs/posts/my_setup/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 06/11 — 2019 | 28 | 07/11 — 2019 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 10.39 | 31 | 10.39 |
diff --git a/docs/posts/pixel_art_in_GIMP/index.html b/docs/posts/pixel_art_in_GIMP/index.html index 25db0ca..122fd35 100644 --- a/docs/posts/pixel_art_in_GIMP/index.html +++ b/docs/posts/pixel_art_in_GIMP/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 08/04 — 2020 | 28 | 09/04 — 2020 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 55.54 | 31 | 55.54 |
diff --git a/docs/posts/plain_text_journaling/index.html b/docs/posts/plain_text_journaling/index.html index b4b4c54..ae47471 100644 --- a/docs/posts/plain_text_journaling/index.html +++ b/docs/posts/plain_text_journaling/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 18/06 — 2023 | 28 | 19/06 — 2023 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 138.66 | 31 | 138.66 |
diff --git a/docs/posts/rapid_refactoring_with_vim/index.html b/docs/posts/rapid_refactoring_with_vim/index.html index cd10d02..622243d 100644 --- a/docs/posts/rapid_refactoring_with_vim/index.html +++ b/docs/posts/rapid_refactoring_with_vim/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 31/03 — 2020 | 28 | 01/04 — 2020 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 79.12 | 31 | 79.12 |
diff --git a/docs/posts/static_sites_with_bash/index.html b/docs/posts/static_sites_with_bash/index.html index 8e6441a..293fa62 100644 --- a/docs/posts/static_sites_with_bash/index.html +++ b/docs/posts/static_sites_with_bash/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 22/11 — 2019 | 28 | 23/11 — 2019 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 21.18 | 31 | 21.18 |
diff --git a/docs/posts/termux_tandem/index.html b/docs/posts/termux_tandem/index.html index 15eb01f..cf7fb77 100644 --- a/docs/posts/termux_tandem/index.html +++ b/docs/posts/termux_tandem/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 07/03 — 2020 | 28 | 08/03 — 2020 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 19.18 | 31 | 19.18 |
diff --git a/docs/posts/turing_complete_type_systems/index.html b/docs/posts/turing_complete_type_systems/index.html index 214e7ff..5a87edf 100644 --- a/docs/posts/turing_complete_type_systems/index.html +++ b/docs/posts/turing_complete_type_systems/index.html | |||
@@ -25,7 +25,7 @@ | |||
25 | ">View Raw</a> | 25 | ">View Raw</a> |
26 | <div class="separator"></div> | 26 | <div class="separator"></div> |
27 | <div class="date"> | 27 | <div class="date"> |
28 | 17/06 — 2020 | 28 | 18/06 — 2020 |
29 | <div class="stats"> | 29 | <div class="stats"> |
30 | <span class="stats-number"> | 30 | <span class="stats-number"> |
31 | 9.19 | 31 | 9.19 |
diff --git a/posts/OSC-52.md b/posts/OSC-52.md new file mode 100644 index 0000000..8dccef9 --- /dev/null +++ b/posts/OSC-52.md | |||
@@ -0,0 +1,66 @@ | |||
1 | I use `ssh` a lot. Copying text from the remote machine to | ||
2 | the host machine always sucked. But OSC-52 makes that easy. | ||
3 | |||
4 | OSC-52 is an ANSI escape sequence to write text to the | ||
5 | terminal emulator. The terminal emulator, if it understands | ||
6 | what is going on, will in turn write this text to the system | ||
7 | clipboard. | ||
8 | |||
9 | What this means is some `printf` magic can send text to your | ||
10 | clipboard. I store this one-liner in a script called | ||
11 | `oclip`: | ||
12 | |||
13 | ```bash | ||
14 | printf "\033]52;c;%s\007" "$(base64 <&0)" | ||
15 | ``` | ||
16 | |||
17 | and I run it with: | ||
18 | |||
19 | ```bash | ||
20 | remote $ cat some_file.txt | oclip | ||
21 | |||
22 | # some_file.txt's contents are now the host's clipboard | ||
23 | ``` | ||
24 | |||
25 | ### The catch | ||
26 | |||
27 | Your terminal emulator must support OSC-52, `alacritty` and | ||
28 | `termux` seem to support this out of the box. In `st`, | ||
29 | OSC-52 works with this change to `config.h`: | ||
30 | |||
31 | ``` | ||
32 | int allowwindowops = 1; | ||
33 | ``` | ||
34 | |||
35 | If you are using `tmux`, you need to flip this switch on: | ||
36 | |||
37 | ``` | ||
38 | set -s set-clipboard on | ||
39 | ``` | ||
40 | |||
41 | If you are inside `nvim`, it may work as expected as long as | ||
42 | `$SSH_TTY` is set. I sometimes physically start a session, | ||
43 | and `ssh` into the same session later from another machine, | ||
44 | and `$SSH_TTY` remains unset, so I force OSC-52 in `nvim` at | ||
45 | all times (see | ||
46 | [nvimdoc](https://neovim.io/doc/user/provider.html#clipboard-osc52)): | ||
47 | |||
48 | ```lua | ||
49 | vim.g.clipboard = { | ||
50 | name = 'OSC 52', | ||
51 | copy = { | ||
52 | ['+'] = require('vim.ui.clipboard.osc52').copy('+'), | ||
53 | ['*'] = require('vim.ui.clipboard.osc52').copy('*'), | ||
54 | }, | ||
55 | paste = { | ||
56 | ['+'] = require('vim.ui.clipboard.osc52').paste('+'), | ||
57 | ['*'] = require('vim.ui.clipboard.osc52').paste('*'), | ||
58 | }, | ||
59 | } | ||
60 | ``` | ||
61 | |||
62 | If you are inside `nvim` inside `tmux` inside an `ssh` | ||
63 | session inside `st`, you neeed all of the above tweaks. | ||
64 | `nvim` will pass the contents around to `tmux`, which in | ||
65 | turn will pass the contents to `st`, which should pass it to | ||
66 | your system clipboard. | ||
@@ -1,3 +1,5 @@ | |||
1 | #! /usr/bin/env nix-shell | ||
2 | #! nix-shell -i bash -p dateutils | ||
1 | LIMIT=5000 | 3 | LIMIT=5000 |
2 | read_dom () { | 4 | read_dom () { |
3 | ORIGINAL_IFS=$IFS | 5 | ORIGINAL_IFS=$IFS |