[GH-ISSUE #360] Panic when attempting to use Backtab #160

Closed
opened 2026-03-03 16:23:00 +03:00 by kerem · 4 comments
Owner

Originally created by @spacez320 on GitHub (Jan 11, 2024).
Original GitHub issue: https://github.com/mum4k/termdash/issues/360

Originally assigned to: @spacez320 on GitHub.

Pressing the 'backtab' key (a.k.a. Shift + Tab) throws an error in Termdash.

panic: unknown keyboard key '278' in a keyboard event Backtab
goroutine 31 [running]:
  internal/lib.errorTermdashHandler({0x95a4c0?, 0xc0016f5af0})
    /home/matthew/workspace/personal/cryptarch/internal/lib/display_termdash.go:59 +0x75
  github.com/mum4k/termdash.(*termdash).handleError(...)
    /home/matthew/lib/go/pkg/mod/github.com/mum4k/termdash@v0.18.0/termdash.go:250
  github.com/mum4k/termdash.(*termdash).subscribers.func1({0x95a660?, 0xc0016f5ad0?})
    /home/matthew/lib/go/pkg/mod/github.com/mum4k/termdash@v0.18.0/termdash.go:215 +0xbc
  github.com/mum4k/termdash/private/event.(*subscriber).callback(0xc00033e200, {0x95a660?, 0xc0016f5ad0?})
    /home/matthew/lib/go/pkg/mod/github.com/mum4k/termdash@v0.18.0/private/event/event.go:95 +0x31
  github.com/mum4k/termdash/private/event.(*subscriber).run(0xc00033e200, {0x95d8f0, 0xc0000940a0})
    /home/matthew/lib/go/pkg/mod/github.com/mum4k/termdash@v0.18.0/private/event/event.go:110 +0x5a
  created by github.com/mum4k/termdash/private/event.newSubscriber
    /home/matthew/lib/go/pkg/mod/github.com/mum4k/termdash@v0.18.0/private/event/event.go:89 +0x28d

This is a supported key in Tcell, at least. https://godocs.io/github.com/gdamore/tcell/v2#Key

Currently I have my program throwing away the error with a handler, but would be nice to properly support the key press.

Originally created by @spacez320 on GitHub (Jan 11, 2024). Original GitHub issue: https://github.com/mum4k/termdash/issues/360 Originally assigned to: @spacez320 on GitHub. Pressing the 'backtab' key (a.k.a. Shift + Tab) throws an error in Termdash. ``` panic: unknown keyboard key '278' in a keyboard event Backtab goroutine 31 [running]: internal/lib.errorTermdashHandler({0x95a4c0?, 0xc0016f5af0}) /home/matthew/workspace/personal/cryptarch/internal/lib/display_termdash.go:59 +0x75 github.com/mum4k/termdash.(*termdash).handleError(...) /home/matthew/lib/go/pkg/mod/github.com/mum4k/termdash@v0.18.0/termdash.go:250 github.com/mum4k/termdash.(*termdash).subscribers.func1({0x95a660?, 0xc0016f5ad0?}) /home/matthew/lib/go/pkg/mod/github.com/mum4k/termdash@v0.18.0/termdash.go:215 +0xbc github.com/mum4k/termdash/private/event.(*subscriber).callback(0xc00033e200, {0x95a660?, 0xc0016f5ad0?}) /home/matthew/lib/go/pkg/mod/github.com/mum4k/termdash@v0.18.0/private/event/event.go:95 +0x31 github.com/mum4k/termdash/private/event.(*subscriber).run(0xc00033e200, {0x95d8f0, 0xc0000940a0}) /home/matthew/lib/go/pkg/mod/github.com/mum4k/termdash@v0.18.0/private/event/event.go:110 +0x5a created by github.com/mum4k/termdash/private/event.newSubscriber /home/matthew/lib/go/pkg/mod/github.com/mum4k/termdash@v0.18.0/private/event/event.go:89 +0x28d ``` This is a supported key in Tcell, at least. https://godocs.io/github.com/gdamore/tcell/v2#Key Currently I have my program throwing away the error with a handler, but would be nice to properly support the key press.
kerem 2026-03-03 16:23:00 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@mum4k commented on GitHub (Jan 11, 2024):

Thank you for reporting this @spacez320. Termdash has an intermediate terminalapi layer that allows its users to switch between different implementations (tcell Vs. termbox).

It is in this layer that keys are processed and mapped from specific implementations to Termdash implementation. Looks like all we need to do is support mapping of backtab and maybe a few additional events that were added in the meantime. The support should be added here.

Is this something you would be interested in contributing?

<!-- gh-comment-id:1887672765 --> @mum4k commented on GitHub (Jan 11, 2024): Thank you for reporting this @spacez320. Termdash has an intermediate [terminalapi](https://github.com/mum4k/termdash/tree/master/terminal/terminalapi) layer that allows its users to switch between different implementations (tcell Vs. termbox). It is in this layer that keys are processed and mapped from specific implementations to Termdash implementation. Looks like all we need to do is support mapping of `backtab` and maybe a few additional events that were added in the meantime. The support should be added [here](https://github.com/mum4k/termdash/blob/e4ccfa31022287aa9cc14ff71da847fa7e98fcf5/terminal/tcell/event.go#L30). Is this something you would be interested in contributing?
Author
Owner

@spacez320 commented on GitHub (Jan 11, 2024):

@mum4k Thanks for the response. I'd be happy to contribute this. Let me know if there's a time table, but otherwise should be able to report back soon.

<!-- gh-comment-id:1887773680 --> @spacez320 commented on GitHub (Jan 11, 2024): @mum4k Thanks for the response. I'd be happy to contribute this. Let me know if there's a time table, but otherwise should be able to report back soon.
Author
Owner

@mum4k commented on GitHub (Jan 11, 2024):

Thank you @spacez320, no rush - I don't keep any regular release schedule for Termdash. We can tag a new version once we have your PR in.

Thank you for your help!

<!-- gh-comment-id:1887785173 --> @mum4k commented on GitHub (Jan 11, 2024): Thank you @spacez320, no rush - I don't keep any regular release schedule for Termdash. We can tag a new version once we have your PR in. Thank you for your help!
Author
Owner

@spacez320 commented on GitHub (Jan 27, 2024):

Thanks @mum4k . I have a PR here: https://github.com/mum4k/termdash/pull/362, let me know how it looks.

I didn't touch termbox (it didn't seem tab was really used in that library?), let me know if I should or if I missed some events I should have implemented, or anything else.

<!-- gh-comment-id:1913356010 --> @spacez320 commented on GitHub (Jan 27, 2024): Thanks @mum4k . I have a PR here: https://github.com/mum4k/termdash/pull/362, let me know how it looks. I didn't touch termbox (it didn't seem tab was really used in that library?), let me know if I should or if I missed some events I should have implemented, or anything else.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termdash#160
No description provided.