Closed ghost closed 3 years ago
How can I reproduce?
FIFOs are normally generated using File.tempname
.
Example
crystal eval 'puts File.tempname'
# /run/user/1000/20210316-20946-r2p2z2
Been playing with it more and whilst for me crystal eval 'puts File.tempname'
usually correctly outputs something like /tmp/20210316-11394-1qcbr4k
, for some reason, when run in a shell spawned by kakoune (kcr doesnt matter) crystal eval 'puts File.tempname'
will simply output something like: 20210316-11762-78pds8
causing it to be created in the current directory. This actually breaks many kcr commands as if the shells current directory is different from kakounes then the pipe is opened and never written to as kakoune instead writes them to a new text file of the same name in its directory.
So this is a problem of how shells spawned by kakoune handle it differently for some reason. I am unsure if this maybe something wrong with my configuration, although opening a kakoune session with no kakrc after renaming it and then initing kcr leads to the same problems.
edit: just tested some more and it only occurs in tmux panes/windows that kakoune spawns. Normal terminals such as those made with popup work normally. Normal tmux panes/windows that kakoune doesn't spawn work normally too, only those kakoune creates have problems
edit 2: It does not occur in panes created by tmux-repl, only ones created with tmux-terminal
edit 3: looking at the differences between tmux.kak and repl/tmux.kak, for some reason tmux-terminal has this in the tmux command env TMPDIR="$TMPDIR"
. I checked and my TMPDIR environment variable is blank, setting it to /tmp/
before running kak fixes everything. Unsure why tmux-terminal has this in its command though
My TMPDIR is normally empty, but it didnt cause problems until tmux.kak sets it to be nothing again and breaks it for some reason. So long as its not empty originally it works fine. I've just set it in my bashrc now so its all fixed
I think it is because the variable is set and visible by env
.
Your TMPDIR
is normally not set, but tmux.kak
sets it to an empty value, resulting the bug.
It can be verified with the following command:
env | grep TMPDIR
Ah, yes that seems to be what's happening, thanks.
Closing, as not a bug from kakoune.cr: it correctly honors the TMPDIR
value.
@Elither Do you mind opening an issue upstream? It looks @topisani has the same problem.
Running many kcr commands in an incorrect way leaves behind a fifo/named pipe in the current directory. If not removed these can clutter and cause a mess. Would it be possible to instead place them in the /tmp folder where they would not be likely to cause issues and would eventually not require manual removal?