pmattes / x3270

Family of IBM 3270 emulators
46 stars 18 forks source link

Can't quit emulator with keyboard shortcut #69

Closed blackbit42 closed 11 months ago

blackbit42 commented 11 months ago

The c3270 default config contains:

[base:14] Ctrl<Key>A <Key>q: Quit()

Ctrl-A is apparently being recognized by the emulator, indicated by a C in OIA. At least that what I think the C signifies. Though, hitting q then yields no action. Similarly, alt-q in x3270 doesn't end the emulator either.

What might I be doing wrong here?

I tried to play around with custom keymaps to test the waters with Quit(-force) and whatnot and came up with:

c3270.keymap.mine: Ctrl<Key>A <Key>n: Quit(-force) Ctrl<Key>A <Key>q: Menu()
c3270.keymap: base,mine

Unfortunately that results in

Keymap mine, line 1: error:
Syntax error in action name at column 37

Column 37 is :. I have no idea whatsoever what is off here.

pmattes commented 11 months ago

I can certainly change the default c3270 keymap so that ^A, q is Quit(-force) instead of Quit().

The issue with your keymap is that you have put two entries on one line. The proper syntax would be:

c3270.keymap.mine: Ctrl<Key>A <Key>n: Quit(-force)\n\
 Ctrl<Key>A <Key>q: Menu()
c3270.keymap: base,mine
blackbit42 commented 11 months ago
c3270.keymap.mine: \n\
 Ctrl<Key>A <Key>q: Quit(-force)
c3270.keymap: base,mine

This now makes c3270 quit on ^-a q. i guess the relevant part of the [documentation](https://x3270.miraheze.org/wiki/Quit()_action) is:

Unless the -force option is given (New in 4.0), the emulator will not terminate if Quit() is invoked from a keymap and there is a host session active.

Thanks for your help.