[GH-ISSUE #489] TreeView button to jump up one level #355

Closed
opened 2026-03-04 01:04:17 +03:00 by kerem · 4 comments
Owner

Originally created by @SoMuchForSubtlety on GitHub (Aug 22, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/489

Would it be possible to bind left arrow / h to jump up one level in a TreeView? I can make a pull request if you approve.

Originally created by @SoMuchForSubtlety on GitHub (Aug 22, 2020). Original GitHub issue: https://github.com/rivo/tview/issues/489 Would it be possible to bind left arrow / h to jump up one level in a TreeView? I can make a pull request if you approve.
kerem closed this issue 2026-03-04 01:04:17 +03:00
Author
Owner

@rivo commented on GitHub (Oct 15, 2020):

I could probably add a new key binding to jump up one level. But it can't be "left arrow" because it's used for something else already. Maybe Ctrl-Left-Arrow (if that's possible). The question is also if that key binding should also cause all children to collapse or simply jump up without collapsing. Any thoughts?

<!-- gh-comment-id:709310337 --> @rivo commented on GitHub (Oct 15, 2020): I could probably add a new key binding to jump up one level. But it can't be "left arrow" because it's used for something else already. Maybe Ctrl-Left-Arrow (if that's possible). The question is also if that key binding should also cause all children to collapse or simply jump up without collapsing. Any thoughts?
Author
Owner

@rivo commented on GitHub (Nov 17, 2020):

If there's no further input regarding this topic, I will close this issue.

<!-- gh-comment-id:729137957 --> @rivo commented on GitHub (Nov 17, 2020): If there's no further input regarding this topic, I will close this issue.
Author
Owner

@SoMuchForSubtlety commented on GitHub (Dec 6, 2020):

Sorry for the late response.

KeyLeft currently does the same thing as KeyUp in a TreeView, right? Ctrl+KeyLeft would also work. I assume making it possible to reassign the default key bindings to allow deeper customization would entail a large amount of work that is probably not worth the effort.

For collapsing I would tend to say no, but that could maybe be a configurable setting?

<!-- gh-comment-id:739579937 --> @SoMuchForSubtlety commented on GitHub (Dec 6, 2020): Sorry for the late response. `KeyLeft` currently does the same thing as `KeyUp` in a TreeView, right? `Ctrl`+`KeyLeft` would also work. I assume making it possible to reassign the default key bindings to allow deeper customization would entail a large amount of work that is probably not worth the effort. For collapsing I would tend to say no, but that could maybe be a configurable setting?
Author
Owner

@rivo commented on GitHub (Jan 11, 2021):

I've added the "K" and "J" key binds to the TreeView which move you up and down the hierarchy, respectively. Unfortunately, there is no CtrlKeyLeft and using the key mod in tcell is apparently not reliable on all platforms.

But if you want to have your own key binds, you could use SetInputCapture() to translate them.

<!-- gh-comment-id:758011852 --> @rivo commented on GitHub (Jan 11, 2021): I've added the "K" and "J" key binds to the `TreeView` which move you up and down the hierarchy, respectively. Unfortunately, there is no `CtrlKeyLeft` and using the key mod in `tcell` is apparently not reliable on all platforms. But if you want to have your own key binds, you could use `SetInputCapture()` to translate them.
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/tview#355
No description provided.