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

Intermittent error while reading clipboard on Linux #88

Closed
caleb-allen opened this issue Aug 30, 2023 · 1 comment
Closed

Intermittent error while reading clipboard on Linux #88

caleb-allen opened this issue Aug 30, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@caleb-allen
Copy link
Owner

After enabling the clipboard feature using VimBindings.Config.system_clipboard!(true), I occasionally get an error while trying to paste the clipboard with p.

I'm running wayland with sway 1.8.1, and the clipboard appears to be attempting to read from xclip (instead of wl-paste).

This probably needs a PR to julia itself, but I want to record it here anyways.

julia> Error: target STRING not available
┌ Error: Could not read clipboard
│   exception =
│    failed process: Process(`xclip -quiet -out -selection clipboard`, ProcessExited(1)) [1]
│    
│    Stacktrace:
│      [1] pipeline_error
│        @ ./process.jl:565 [inlined]
│      [2] read(cmd::Base.CmdRedirect)
│        @ Base ./process.jl:449
│      [3] read
│        @ ./process.jl:458 [inlined]
│      [4] clipboard()
│        @ InteractiveUtils ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/InteractiveUtils/src/clipboard.jl:75
│      [5] put(buf::IOBuffer, reg::Char)
│        @ VimBindings.Operators ~/.julia/dev/VimBindings/src/operator.jl:122
│      [6] put
│        @ ~/.julia/dev/VimBindings/src/operator.jl:119 [inlined]
│      [7] execute(buf::IOBuffer, command::VimBindings.Commands.PasteCommand)
│        @ VimBindings.Execution ~/.julia/dev/VimBindings/src/execute.jl:206
│      [8] strike_key(c::String, s::REPL.LineEdit.MIState)
│        @ VimBindings ~/.julia/dev/VimBindings/src/VimBindings.jl:133
│      [9] (::VimBindings.var"#9#11"{Dict{Char, Any}, VimBindings.var"#8#10"{REPL.LineEdit.var"#139#195", String}, String})(s::REPL.LineEdit.MIState, p::REPL.LineEditREPL)
│        @ VimBindings ~/.julia/dev/VimBindings/src/lineeditalt.jl:80
│     [10] prompt!(term::REPL.Terminals.TTYTerminal, prompt::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│        @ VimBindings ~/.julia/dev/VimBindings/src/lineeditalt.jl:34
│     [11] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/LineEdit.jl:2642
│     [12] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
│        @ REPL ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:1300
│     [13] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
│        @ REPL ./task.jl:514
└ @ VimBindings.Operators ~/.julia/dev/VimBindings/src/operator.jl:124
julia> ┌ Error: Error while executing vim key strike
│   exception =
│    BoundsError: attempt to access 0-element Vector{UInt8} at index [2]
│    Stacktrace:
│      [1] _growat!
│        @ ./array.jl:1016 [inlined]
│      [2] splice!(a::Vector{UInt8}, r::UnitRange{Int64}, ins::Base.CodeUnits{UInt8, String})
│        @ Base ./array.jl:1759
│      [3] edit_splice!(s::Union{REPL.LineEdit.MIState, REPL.LineEdit.ModeState, IOBuffer}, r::Pair{Int64, Int64}, ins::String; rigid_mark::Bool)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/LineEdit.jl:764
│      [4] edit_splice!
│        @ ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/LineEdit.jl:744 [inlined]
│      [5] insert
│        @ ~/.julia/dev/VimBindings/src/operator.jl:107 [inlined]
│      [6] insert
│        @ ~/.julia/dev/VimBindings/src/operator.jl:105 [inlined]
│      [7] macro expansion
│        @ ~/.julia/dev/VimBindings/src/execute.jl:65 [inlined]
│      [8] macro expansion
│        @ ~/.julia/packages/Match/XemzX/src/matchmacro.jl:408 [inlined]
│      [9] execute(buf::IOBuffer, command::VimBindings.Commands.InsertCommand)
│        @ VimBindings.Execution ~/.julia/dev/VimBindings/src/execute.jl:63
│     [10] strike_key(c::String, s::REPL.LineEdit.MIState)
│        @ VimBindings ~/.julia/dev/VimBindings/src/VimBindings.jl:133
│     [11] (::VimBindings.var"#9#11"{Dict{Char, Any}, VimBindings.var"#8#10"{REPL.LineEdit.var"#139#195", String}, String})(s::REPL.LineEdit.MIState, p::REPL.LineEditREPL)
│        @ VimBindings ~/.julia/dev/VimBindings/src/lineeditalt.jl:80
│     [12] prompt!(term::REPL.Terminals.TTYTerminal, prompt::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│        @ VimBindings ~/.julia/dev/VimBindings/src/lineeditalt.jl:34
│     [13] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/LineEdit.jl:2642
│     [14] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
│        @ REPL ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:1300
│     [15] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
│        @ REPL ./task.jl:514
└ @ VimBindings ~/.julia/dev/VimBindings/src/lineeditalt.jl:82
@caleb-allen caleb-allen added the bug Something isn't working label Aug 30, 2023
@caleb-allen
Copy link
Owner Author

Closing this since it is an issue with InteractiveUtils, not VimBindings

@caleb-allen caleb-allen closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2024
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