<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ruslan&#39;s Tech Blog</title>
    <link>https://blog.bekenev.net/tags/docker-terminal.html</link>
    <description>Software development related stuff</description>
    <language>en-us</language>
    <lastBuildDate>Thu, 01 Mar 2018 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.bekenev.net/tags/docker-terminal/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Docker detach keys</title>
      <link>https://blog.bekenev.net/2018/03/01/docker-terminal-navigation.html</link>
      <pubDate>Thu, 01 Mar 2018 00:00:00 +0000</pubDate>
      <guid>https://blog.bekenev.net/2018/03/01/docker-terminal-navigation.html</guid>
      <description>&lt;p&gt;If you like me and use CTRL-P/CTRL-N instead of arrow keys to navigate through command history, you should be disappointed&#xA;on how CTRL-P works in docker terminal (the one you see after docker run, docker exec).&lt;/p&gt;&#xA;&lt;p&gt;It turned out CTRL-P is used for what they call detaching from terminal, which I didn&amp;rsquo;t know about even.&lt;/p&gt;&#xA;&lt;p&gt;So basically when you press CTRL-P the terminal is waiting for another key press (CTRL-Q in current case). That&amp;rsquo;s why CTRL-P&#xA;works in strange way.&lt;/p&gt;&#xA;&lt;p&gt;The issue &lt;a target=&#34;_blank&#34; href=&#34;https://github.com/moby/moby/pull/15666&#34;&gt;was solved&lt;/a&gt; couple of years ago.&lt;/p&gt;&#xA;&lt;p&gt;What you need to do is create &lt;code&gt;.docker&lt;/code&gt; folder in your home directory (&lt;code&gt;mkdir ~/.docker&lt;/code&gt;) and create &lt;code&gt;config.json&lt;/code&gt; file there with this content:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;detachKeys&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;ctrl-@&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br/&gt;&#xA;You can use other keys of course but CTRL-P should work as usual right now.&#xA;</description>
    </item>
  </channel>
</rss>
