Skip to content

REPL hints and tab completion freezes the REPL #55434

@thofma

Description

@thofma

Sometimes tab completion freezes the REPL. For example, I type

julia> complicated_hard_to_infer_function(f(x) * y, g(x), TAB

and this gives me a frozen REPL for a few minutes, where not even Ctrl-C does something useful. Not a great user experience (in particular the Ctrl-C not responding part).

@MasonProtter provided the following reproducer (my original example is free of @generated):

julia> @generated function foo()
           @info "Compiling foo()"
           sleep(10)
           (;a=1, b=2)
       end;

julia> foo().[ Info: Compiling foo()

This is with julia 1.10.

Can we make the under the hood type inference give up if the result cannot be returned "immediately"? Alternatively, can we make Ctrl-C work?

Edit: It is really bad on 1.11, where this is triggered by the tab completion "hint", so almost always.

Edit edit: For the fellow victims of this: One can turn it off (on 1.11) by typing the following in the REPL

Base.active_repl.options.hint_tab_completes = false

or putting

atreplinit() do repl
    if VERSION >= v"1.11.0-0"
        repl.options.hint_tab_completes = false
    end
end

in your startup.jl.

Metadata

Metadata

Assignees

No one assigned

    Labels

    REPLJulia's REPL (Read Eval Print Loop)bugIndicates an unexpected problem or unintended behaviorcompletionsTab and autocompletion in the repl

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions