[bug]: zsh-autocomplete creates file called $'\374'$'\227'$'\374'$'\233'$'\374' in working directory when completing [[ with long lines in history file and terminal in 256 color mode #523
Yes, I know this sounds insane. Because of that I have produced a ready to execute Dockerfile that reproduces the issue, see below. If I get rid of any of the requirements mentioned in the issue title, the problem no longer occurs.
wit% sudo docker run -it --rm bug
Downloading marlonrichert/zsh-autocomplete...
Cloning into '/root/.zinit/plugins/marlonrichert---zsh-autocomplete'...
β Έ βββββββββββββββββββββββββ OBJ: 100, PACK: 4013/4013, COMPR: 100%, REC: 100%, RES: 100%
==> Compiling zsh-autocomplete.plugin.zsh [OK]
==> Installed 8 completions
cdb4ff385b90# env -i TERM=xterm-256color zsh
cdb4ff385b90# ls -lA
total 0
cdb4ff385b90# [[
cdb4ff385b90# ls -lA
total 0
-rw-r--r-- 1 root root 0 May 13 03:34 ''$'\374\227\374\233\374'
In the step where I type [[, I include a space after the [[ and then press ^C to abort the command. Deleting the typed characters also works. The point is to trigger autocompletions for [[. Observe that a file called $'\374'$'\227'$'\374'$'\233'$'\374' has somehow appeared in the working directory, which was previously empty.
Just to make sure this wasn't a problem with the terminal emulator on my machine, I signed up for a free account on Google Cloud Shell and ran the same test case there, with the same result:
What happened?
Exactly what it says in the title.
Yes, I know this sounds insane. Because of that I have produced a ready to execute Dockerfile that reproduces the issue, see below. If I get rid of any of the requirements mentioned in the issue title, the problem no longer occurs.
Reporting the bug here because per the maintainer of zsh-autocomplete, this is the fault of zinit: https://github.com/marlonrichert/zsh-autocomplete/issues/588#issuecomment-1556551280
Steps to reproduce
Build and run the following Dockerfile:
E.g.,
docker build . -t bug && docker run -it --rm bug
.Then, perform the following steps:
In the step where I type
[[
, I include a space after the[[
and then press^C
to abort the command. Deleting the typed characters also works. The point is to trigger autocompletions for[[
. Observe that a file called$'\374'$'\227'$'\374'$'\233'$'\374'
has somehow appeared in the working directory, which was previously empty.Just to make sure this wasn't a problem with the terminal emulator on my machine, I signed up for a free account on Google Cloud Shell and ran the same test case there, with the same result:
Relevant output
No response
Screenshots and recordings
Operating System & Version
OS: linux-gnu | Vendor: ubuntu | Machine: x86_64 | CPU: x86_64 | Processor: x86_64 | Hardware: x86_64
Zsh version
zsh 5.8.1 (x86_64-ubuntu-linux-gnu)
Terminal emulator
xterm-256color
If using WSL on Windows, which version of WSL
None
Additional context
No response
Code of Conduct