Skip to content

A possibly needed workaround for <( ) process substitution #364

@psprint

Description

@psprint

Hello,
in branch develop there's currently use of <( ... ) process substitution to do asynchronous calls:

exec {_ZSH_AUTOSUGGEST_ASYNC_FD}< <(
# Tell parent process our pid
echo $sysparams[pid]
# Fetch and print the suggestion
local suggestion
_zsh_autosuggest_fetch_suggestion "$1"
echo -nE "$suggestion"
)

I use the same technique in fast-syntax-highlighting, however, I add command sleep 0 (could make it command true) after the exec: https://github.com/zdharma/fast-syntax-highlighting/blob/e06288a617b12e8038fdf5bc4bd40b6a25ef5332/fast-highlight#L917-L918

The reason for this additional call are severe problems with Ctrl-C that occur when using {MYFD}< construct, as my investigation showed.

So in this issue I just want to mention that in case of any Ctrl-C problems, command true after exec should help.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions