Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper escape sequence handling with Julia 1.8 #19

Closed
caleb-allen opened this issue Sep 25, 2022 · 9 comments
Closed

Proper escape sequence handling with Julia 1.8 #19

caleb-allen opened this issue Sep 25, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@caleb-allen
Copy link
Owner

caleb-allen commented Sep 25, 2022

VimBindings.jl may require some core changes in order to be compatible with the Julia 1.8 REPL. It appears that there has been a shift in the way in which escape codes are handled, this need to be investigated for Julia 1.8 to function correctly with detecting the Esc key.

@caleb-allen caleb-allen added the bug Something isn't working label Sep 25, 2022
@caleb-allen caleb-allen changed the title Compatibility with Julia 1.8 Proper escape sequence handling with Julia 1.8 Sep 28, 2022
@caleb-allen
Copy link
Owner Author

Related to #8

@caleb-allen
Copy link
Owner Author

Possibly caused by new handling of modifier keys? JuliaLang/julia@e87e30c#diff-715d7c2a15e1520009fe6ad08ceeb3b562be4f43b4e7c5a95d45036c30564edaR109

@caleb-allen
Copy link
Owner Author

Also could be an issue with code loading at startup: JuliaLang/julia#43708

@caleb-allen
Copy link
Owner Author

It also could be a change in the way escape sequences are handled: JuliaLang/julia@7a4cef7#diff-4ed83eb0e27660d0dbbbbb112e70147cd25c5264a38731abc806a02c2d37dc62R26

@caleb-allen
Copy link
Owner Author

Or, halting processing of input until there is a delay between inputs. This directly violates the way in which VimBindings.jl detects the striking of the Esc key (using time-based input processing)

JuliaLang/julia@26d887e

@caleb-allen
Copy link
Owner Author

Or, halting processing of input until there is a delay between inputs. This directly violates the way in which VimBindings.jl detects the striking of the Esc key (using time-based input processing)

JuliaLang/julia@26d887e

The time delay is only set on Windows by default, so while this may cause an issue on Windows, this is not the cause of this issue as it is in 1.7 which behaves just fine

@caleb-allen
Copy link
Owner Author

This may be due to the new way tasks are handled: JuliaLang/julia#41449

If LineEdit.run_interface is run from within a task, then the replacement run_interface method overwritten by VimBindings would be shadowed because its world age would be higher than the task running the REPL.

In other words, the previous run_interface method may be calling the outdated prompt! method.

A simple solution is to call Base.invokelatest, but that would require overwriting much more REPL code.

Perhaps there is an easier solution to the code loading problem in general, to somehow load all of the overriding code before any "interface" code is executed at all.

https://github.com/JuliaLang/julia/blob/0c382c245a0d428aae6c593d5def8e6f73dafe34/stdlib/REPL/src/LineEdit.jl#L2637-L2646

@caleb-allen
Copy link
Owner Author

@caleb-allen
Copy link
Owner Author

The solution here is to load VimBindings before the REPL is initialized, from the invocation of Julia rather than in startup.jl, as described in the readme like so:

julia -i -e "using VimBindings"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant