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

Since fix for #479, paste doesn't work on some terminal anymore #514

Closed
jbonofre opened this issue Mar 2, 2020 · 2 comments
Closed

Since fix for #479, paste doesn't work on some terminal anymore #514

jbonofre opened this issue Mar 2, 2020 · 2 comments
Milestone

Comments

@jbonofre
Copy link
Contributor

jbonofre commented Mar 2, 2020

See https://issues.apache.org/jira/browse/KARAF-6613 for details.

@spannm
Copy link

spannm commented Mar 23, 2020

We also suffer from this in our software.
Last version that did not have this issue is 3.12.1
A fix would be great! Thanks in advance.

@jbonofre
Copy link
Contributor Author

jbonofre commented Apr 4, 2020

I fixed the issue be reverting the beginPaste() method in LineReaderImpl:

public boolean beginPaste() {
        final Object SELF_INSERT = new Object();
        final Object END_PASTE = new Object();
        KeyMap<Object> keyMap = new KeyMap<>();
        keyMap.setUnicode(SELF_INSERT);
        keyMap.setNomatch(SELF_INSERT);
        keyMap.setAmbiguousTimeout(0);
        keyMap.bind(END_PASTE, BRACKETED_PASTE_END);
        StringBuilder sb = new StringBuilder();
        while (true) {
            Object b = doReadBinding(keyMap, null);
            if (b == END_PASTE) {
                break;
            }
            String s = getLastBinding();
            if ("\r".equals(s)) {
            s = "\n";
            }
            sb.append(s);
        }
        regionActive = RegionType.PASTE;
        regionMark = getBuffer().cursor();
        getBuffer().write(sb);
        return true;
    }

I'm checking for a better fix, leveraging the change introduced in #479

@gnodet gnodet closed this as completed in df9f1f9 Apr 8, 2020
@mattirn mattirn added this to the 3.14.1 milestone Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants