Re: tramp (2.7.3.30.2 nil/nil); podman/docker incompatible container list output format

Samuele FAVAZZA <[email protected]> Fri, 3 Jul 2026 08:54:06 +0200
Newsgroups gmane.emacs.tramp
Message-ID <CAL7E7WzZhLy5z1P2zPW9dJSv2VcA+DFB2V7Q36H3644gj13__Q@mail.gmail.com>
--000000000000bdf7750655af6446
Content-Type: text/plain; charset="UTF-8"

Hello Michael,

Thanks for the prompt reply. I found the issue working on a Ubuntu 22.04.5
LTS which features 'podman version 3.4.4'.

Best regards,
Samuele


On Thu, Jul 2, 2026, 21:27 Michael Albinus <[email protected]> wrote:

> Samuele FAVAZZA <[email protected]> writes:
>
> > Hello all,
>
> Hi Samuele,
>
> > The observed issue concerns the listing of containers suggested after
> > inserting either '/docker:' or '/podman:' as tramp connection methods.
> > In particular the 'docker' method flawlessly lists the available
> > containers that can be accessed but 'podman' does not.
> >
> > Searching for the cause I identified the issue in the
> > 'tramp-container--completion-function' function. Upon invocation
> > of the '[podman|docker] ps --format '{{.ID}}\t{{.Names}}' command, the
> > resulting list of strings are different. See the examples below
> > (executed in a shell after starting a container in docker and one in
> > podman):
> >
> >
> > $ docker ps --format '{{.ID}}\t{{.Names}}' | od -c | head -1
> >   0000000   3   2   e   5   d   a   8   f   9   5   d   8  \t   v   a   n
> >
> > $ podman ps --format '{{.ID}}\t{{.Names}}' | od -c | head -1
> >   0000000   c   c   c   f   e   9   7   6   1   c   5   3           r   e
> >
> > As can be observed 'podman' replaces the '\t' charter with a sequence of
> > 2 spaces, causing the parsing of the tool output to fail in
> > 'tramp-container--completion-function'.
>
> I'm curious: where do you run podman? In my Fedora 44 system, I see
>
> --8<---------------cut here---------------start------------->8---
> $ podman ps --format '{{.ID}}\t{{.Names}}' | od -c | head -1
> 0000000   c   1   6   f   7   d   2   4   0   7   b   2  \t   g   r   a
> $ podman -v
> podman version 5.8.3
> --8<---------------cut here---------------end--------------->8---
>
> Or is it your shell, which does the transformation?
>
> > I have successfully tested the following patch:
>
> Likely, we will apply your patch. But first I'd like to understand why
> this happens.
>
> > Best regards,
> > Samuele Favazza
>
> Best regards, Michael.
>

--000000000000bdf7750655af6446
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div>Hello Michael,<div dir=3D"auto"><br></div><div dir=
=3D"auto">Thanks for the prompt reply. I found the issue working on a Ubunt=
u 22.04.5 LTS which features &#39;podman version 3.4.4&#39;.</div><div dir=
=3D"auto"><br></div><div dir=3D"auto">Best regards,=C2=A0</div><div dir=3D"=
auto">Samuele</div><br><br><div class=3D"gmail_quote gmail_quote_container"=
><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 2, 2026, 21:27 Michael A=
lbinus &lt;<a href=3D"mailto:[email protected]">[email protected]=
</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Samuele FAVAZZA &lt=
;<a href=3D"mailto:[email protected]" target=3D"_blank" rel=3D"nore=
ferrer">[email protected]</a>&gt; writes:<br>
<br>
&gt; Hello all,<br>
<br>
Hi Samuele,<br>
<br>
&gt; The observed issue concerns the listing of containers suggested after<=
br>
&gt; inserting either &#39;/docker:&#39; or &#39;/podman:&#39; as tramp con=
nection methods.<br>
&gt; In particular the &#39;docker&#39; method flawlessly lists the availab=
le<br>
&gt; containers that can be accessed but &#39;podman&#39; does not.<br>
&gt;<br>
&gt; Searching for the cause I identified the issue in the<br>
&gt; &#39;tramp-container--completion-function&#39; function. Upon invocati=
on<br>
&gt; of the &#39;[podman|docker] ps --format &#39;{{.ID}}\t{{.Names}}&#39; =
command, the<br>
&gt; resulting list of strings are different. See the examples below<br>
&gt; (executed in a shell after starting a container in docker and one in<b=
r>
&gt; podman):<br>
&gt;<br>
&gt;<br>
&gt; $ docker ps --format &#39;{{.ID}}\t{{.Names}}&#39; | od -c | head -1<b=
r>
&gt;=C2=A0 =C2=A00000000=C2=A0 =C2=A03=C2=A0 =C2=A02=C2=A0 =C2=A0e=C2=A0 =
=C2=A05=C2=A0 =C2=A0d=C2=A0 =C2=A0a=C2=A0 =C2=A08=C2=A0 =C2=A0f=C2=A0 =C2=
=A09=C2=A0 =C2=A05=C2=A0 =C2=A0d=C2=A0 =C2=A08=C2=A0 \t=C2=A0 =C2=A0v=C2=A0=
 =C2=A0a=C2=A0 =C2=A0n<br>
&gt;<br>
&gt; $ podman ps --format &#39;{{.ID}}\t{{.Names}}&#39; | od -c | head -1<b=
r>
&gt;=C2=A0 =C2=A00000000=C2=A0 =C2=A0c=C2=A0 =C2=A0c=C2=A0 =C2=A0c=C2=A0 =
=C2=A0f=C2=A0 =C2=A0e=C2=A0 =C2=A09=C2=A0 =C2=A07=C2=A0 =C2=A06=C2=A0 =C2=
=A01=C2=A0 =C2=A0c=C2=A0 =C2=A05=C2=A0 =C2=A03=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0r=C2=A0 =C2=A0e<br>
&gt;<br>
&gt; As can be observed &#39;podman&#39; replaces the &#39;\t&#39; charter =
with a sequence of<br>
&gt; 2 spaces, causing the parsing of the tool output to fail in<br>
&gt; &#39;tramp-container--completion-function&#39;.<br>
<br>
I&#39;m curious: where do you run podman? In my Fedora 44 system, I see<br>
<br>
--8&lt;---------------cut here---------------start-------------&gt;8---<br>
$ podman ps --format &#39;{{.ID}}\t{{.Names}}&#39; | od -c | head -1<br>
0000000=C2=A0 =C2=A0c=C2=A0 =C2=A01=C2=A0 =C2=A06=C2=A0 =C2=A0f=C2=A0 =C2=
=A07=C2=A0 =C2=A0d=C2=A0 =C2=A02=C2=A0 =C2=A04=C2=A0 =C2=A00=C2=A0 =C2=A07=
=C2=A0 =C2=A0b=C2=A0 =C2=A02=C2=A0 \t=C2=A0 =C2=A0g=C2=A0 =C2=A0r=C2=A0 =C2=
=A0a<br>
$ podman -v<br>
podman version 5.8.3<br>
--8&lt;---------------cut here---------------end---------------&gt;8---<br>
<br>
Or is it your shell, which does the transformation?<br>
<br>
&gt; I have successfully tested the following patch:<br>
<br>
Likely, we will apply your patch. But first I&#39;d like to understand why<=
br>
this happens.<br>
<br>
&gt; Best regards,<br>
&gt; Samuele Favazza<br>
<br>
Best regards, Michael.<br>
</blockquote></div></div></div>

--000000000000bdf7750655af6446--