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

[Bug] Backspace and arrow keys misbehaving in cli-mode #107

Closed
ManIVIctorious opened this issue May 11, 2020 · 4 comments
Closed

[Bug] Backspace and arrow keys misbehaving in cli-mode #107

ManIVIctorious opened this issue May 11, 2020 · 4 comments

Comments

@ManIVIctorious
Copy link

Hi, as the title says in cli-mode the flatpaked octave package (doesn't happen with the distribution provided (arch linux)) backspace and arrow keys do not work as intended.
While backspace doesn't delete, but instead moves to the right two to three times and then locks, I haven't actually figured out yet what the arrow keys are doing (except of pasting weird stuff, e.g. # Octave 5.2.0, Tue May 12 00:55:49 2020 CEST)

Interestingly running octave in gui mode works flawlessly.

Since octave has full host filesystem permissions I first thought this could be some clash with my .inputrc file, so I moved it, but unfortunately this didn't help.

I also thought it could be related to issue#53 keyboard behaves poorly after ctrl-c since I sometimes get the same
�%�
parse error:
invalid character '�' (ASCII 254)
error message, so I tried the suggested workaround
flatpak run --command=bash org.octave.Octave
which led to another error concerning vte, which looks pretty promising in my opinion.
Also, just running this bash command breaks my terminal emulator the same way octave is broken.
bash: /etc/profile.d/vte.sh: No such file or directory
bash: __vte_prompt_command: command not found

octave version: 5.2.0
flatpak commit: 7c4fbf39525ff7347aa0b16085b7ac55053df11649660c93365254da02cce6c1
terminal emulator: termite version 15 (VTE-based)

Please let me know if I can provide you any additional info to resolve this issue,
Mani

@mtmiller
Copy link
Collaborator

Unfortunately not reproducible here, so yes it looks like you'll have to provide a lot more info. As a wild guess, looks related to your particular terminal emulator, keyboard escape sequences, and possibly your readline configuration.

As a start, can you reproduce this with a newly created user account, or with an empty temporary home directory, and/or running bash --norc?

If running bash alone is enough to reproduce this, then it doesn't seem like an Octave bug at all, right? What magic is in your dotfiles that fixes this, and why doesn't your terminal emulator work without it? That's where I would start. Or maybe try a different terminal emulator.

@ManIVIctorious
Copy link
Author

ManIVIctorious commented Jun 2, 2020

I am very sorry it took me so long to answer, but I am not very familiar with debugging flatpak applications...
I actually never suspected that octave itself is at fault, but rather thought of it as a packaging issue.

The issue doesn't seem to have to do anything with my rcs. Actually that would have surprised me anyway, the only thing that is not pretty standard is that I prefer vi mode which caused issues with octave in the past (therefore I set "shopt -o vi" in the bashrc instead of the inputrc which fixed these issues years ago).

The strange behaviour is still reproducible (at least when using the termite terminal emulator), but as already stated it also happens when just doing a flatpak enter into org.octave.Octave and running a shell from there.
As I understand the issue arises from the non existence of an appropriate terminfo file and after some thought I realised that this may be part of the used kde runtime instead of the individual packages. It just happened to show up in octave only since it is my only terminal application using org.kde.Sdk//5.14.

I tried multiple flatpak enters into different applications/runtimes and the behaviour is reproducible in all using the org.kde.Platform runtime in versions 5.12 as well as 5.14 (didn't have other versions installed). On the other hand I did not encounter the issues in the org.gnome.Platform version 3.36.

So it does definitely seem to be a packaging issue and I am pretty sure you are not blame, sorry for the noise. I will write a bug ticket at the org.kde.Platform.

Oh and sorry for the very lengthy post

@ManIVIctorious
Copy link
Author

Oh, forgot to comment about that:

What magic is in your dotfiles that fixes this, and why doesn't your terminal emulator work without it?

I managed to "fix" (more like a workaround) it by exporting TERM=xterm-color

@mtmiller
Copy link
Collaborator

mtmiller commented Jun 2, 2020

Wow, interesting, I guess the termite terminal emulator is that different that it uses its own custom terminfo definition file for handling delete and arrow keys and possibly other special key escapes.

The reason the GUI command window works is because Octave declares its own built in terminal emulator to be plain old xterm compatible.

Interesting that it works in org.gnome.Platform but not in org.kde.Platform, they have the same file /usr/share/terminfo/t/termite. But ok, glad you were able to identify this as a problem with the runtime, good luck.

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

2 participants