feat: toggle hidden directories in cd-browser with . key

This commit is contained in:
2026-04-02 16:28:21 +02:00
parent 9688ed0974
commit ab689cfbb4
6 changed files with 69 additions and 13 deletions

View File

@@ -145,7 +145,8 @@ class TerminalUI:
stdscr.refresh()
return
path_text = str(navigator.current_path)
hidden_status = "on" if navigator.show_hidden else "off"
path_text = f"{navigator.current_path} [hidden: {hidden_status}]"
stdscr.addnstr(0, 0, path_text, width - 1)
lines = build_render_lines(navigator)
@@ -282,6 +283,11 @@ class TerminalUI:
self._tree_scroll_offset = 0
return None
if key == ord("."):
navigator.toggle_hidden()
self._tree_scroll_offset = 0
return None
if key in (curses.KEY_ENTER, 10, 13):
return navigator.selected_entry.path