Author Topic: Configuring byobu (in termux) on Cosmo  (Read 5595 times)

Charlie Stross

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Configuring byobu (in termux) on Cosmo
« on: December 26, 2019, 12:35:42 pm »
I'm trying to use byobu under termux on the Cosmo (in preference to tmux).

However, byobu relies on function keys to interactively create/move/resize terminal windows.

Does anyone know how to access and/or bind function keys on the Cosmo (which doesn't actually *have* F1, F2, etc as separate keys)? Failing that, has anyone got a working boybu-config that uses tmux command keystrokes (ctrl-B whatevs) to control it?

vldmr

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Configuring byobu (in termux) on Cosmo
« Reply #1 on: December 26, 2019, 04:33:00 pm »
In other applications (mc) alt-1 through alt-0 work for f1 through f10. Btw, for escape works alt-space, in mc or vim.

For multiplexer I use screen with the same config I have on other computers.
« Last Edit: December 26, 2019, 04:36:19 pm by vldmr »

Charlie Stross

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Configuring byobu (in termux) on Cosmo
« Reply #2 on: December 27, 2019, 07:49:36 am »
Quote from: vldmr
In other applications (mc) alt-1 through alt-0 work for f1 through f10. Btw, for escape works alt-space, in mc or vim.

Huh. byobu in termux seems to pass alt-1 and alt-0 directly through to mc. Meanwhile, other keystrokes (Ctrl-a ! -- toggle key bindings off/on -- and Ctrl-a $ -- status) seem to be bound to other commands.

... And then, while poking around inside the byobu keyboard binding files, I seem to have kernel panicked my Cosmo!



So byobu ships with termux configured as a back-end, which is fine; and turns out to obey the termux keystroke commands -- which is fine, i can use them instead of the inexplicable vanishing function keystrokes -- except that the modifier key is ctrl-a, not ctrl-b. And this isn't visible anywhere in the man pages, because fsck documentation (and fsck gnu emacs, which is apparently why there's a program -- byobu-ctrl-a -- for messing with the behaviour of ctrl-a under byobo).

(Learning this cost me an hour. I now have a working byobu setup on the Cosmo (and Gemini), and one less hour in my life.
« Last Edit: December 27, 2019, 08:18:23 am by Charlie Stross »

vldmr

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Configuring byobu (in termux) on Cosmo
« Reply #3 on: December 27, 2019, 09:23:54 am »
I never understood why ctrl-a was picked as default modifier - the key is widely used in many programs, like anything using readline. Ctrl-b does make more sense. But myself I set it to ctrl-\ in my config that I carry around. I have not had to deal with any program yet that reserves that by default

Charlie Stross

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Configuring byobu (in termux) on Cosmo
« Reply #4 on: December 27, 2019, 11:49:29 am »
Alas, ctrl-\ is a bad choice for the Gemini/Cosmo layout (backslash is Fn-3, so it's a three-finger salute).

vldmr

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Configuring byobu (in termux) on Cosmo
« Reply #5 on: December 27, 2019, 12:36:29 pm »
Quote from: Charlie Stross
Alas, ctrl-\ is a bad choice for the Gemini/Cosmo layout (backslash is Fn-3, so it's a three-finger salute).
Oh, I see your problem now. Well, on my cosmo it is right where it is found on other keyboards around here - a dedicated key next to enter key. You might be able to utilize corresponding key on your layout.
 [ Invalid Attachment ]

jankratochvil

  • Newbie
  • *
  • Posts: 11
    • View Profile
Configuring byobu (in termux) on Cosmo
« Reply #6 on: December 28, 2019, 09:32:20 am »
Quote from: vldmr
Btw, for escape works alt-space, in mc or vim.

OK, alt-escape does work for VIM, thanks. But still is there a way to make the physical Escape key working as a normal Escape key? I have already bugreported it to Planet as it looks to me as the Cosmo keyboard driver problem as vtshowkeys also cannot catch the Escape key (and it quits from Termux to laucher).

vldmr

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Configuring byobu (in termux) on Cosmo
« Reply #7 on: December 28, 2019, 10:55:04 am »
Quote from: jankratochvil
OK, alt-escape does work for VIM, thanks. But still is there a way to make the physical Escape key working as a normal Escape key? I have already bugreported it to Planet as it looks to me as the Cosmo keyboard driver problem as vtshowkeys also cannot catch the Escape key (and it quits from Termux to laucher).
My understanding that escape is reprogrammed to generate key press for hardware "back" button. Which kind of make sense for most android applications, but not for terminal interface.

I believe that "External keyboard helper" is able to reprogram key press events, but after some thinking I could not decide on which key to move "back" key, so I ended up leaving escape set as is

jankratochvil

  • Newbie
  • *
  • Posts: 11
    • View Profile
Configuring byobu (in termux) on Cosmo
« Reply #8 on: December 28, 2019, 05:07:10 pm »
Quote from: vldmr
I believe that "External keyboard helper" is able to reprogram key press events, but after some thinking I could not decide on which key to move "back" key, so I ended up leaving escape set as is

I have[size=] tried[/size][size=] Keyboard/Button Mapper but it also cannot catch the Escape key - Escape key will ask whether to quit the buttons recording. So the only hope is Planet (as Planet does not opensource any of its software/drivers, right?).[/size]
« Last Edit: December 29, 2019, 02:24:14 am by jankratochvil »

shinkamui

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Configuring byobu (in termux) on Cosmo
« Reply #9 on: December 28, 2019, 09:43:34 pm »
Quote from: jankratochvil
Quote from: vldmr
Btw, for escape works alt-space, in mc or vim.

OK, alt-escape does work for VIM, thanks. But still is there a way to make the physical Escape key working as a normal Escape key? I have already bugreported it to Planet as it looks to me as the Cosmo keyboard driver problem as vtshowkeys also cannot catch the Escape key (and it quits from Termux to laucher).

As a heavy termux user, i find escape working as escape very necessary on this device to really get the touch type workflow going, especially in vim.  I solved this annoyance by editing termux.properties, and setting the back-key property to escape.  This only fixes termux, enabling escape to function correctly in vim and other console apps, as well as no long annoyingly minimizing termux. outside of this escape as back is incredibly convenient in android.

hope this is useful for your needs as well.

jankratochvil

  • Newbie
  • *
  • Posts: 11
    • View Profile
Configuring byobu (in termux) on Cosmo
« Reply #10 on: December 29, 2019, 02:42:18 am »
Quote from: shinkamui
I solved this annoyance by editing termux.properties, and setting the back-key property to escape.

Wow, it really works, thanks a lot! https://wiki.termux.com/wiki/Terminal_Settings

Dickon Hood

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • http://
Configuring byobu (in termux) on Cosmo
« Reply #11 on: December 31, 2019, 06:54:17 am »
Quote from: Charlie Stross
Alas, ctrl-\ is a bad choice for the Gemini/Cosmo layout (backslash is Fn-3, so it's a three-finger salute).

Alas, Ctrl-\ is a bad choice for any terminal program, as by default it sends a SIGQUIT which will coredump the running process.  This gets awkward when you forget you're using something else and muscle-memory it...