Skip to content

feat: log colorization, auto mouse toggling, external pager, and Korean keyboard support - #811

Open
hunchulchoi wants to merge 12 commits into
jesseduffield:masterfrom
hunchulchoi:feat/log-enhancement
Open

feat: log colorization, auto mouse toggling, external pager, and Korean keyboard support#811
hunchulchoi wants to merge 12 commits into
jesseduffield:masterfrom
hunchulchoi:feat/log-enhancement

Conversation

@hunchulchoi

Copy link
Copy Markdown

This PR introduces several quality-of-life enhancements for container logs visibility, copying workflows, external pager integration, and layout compatibility.

Key Changes

  1. Rule-Based Log Highlighting:

    • Implemented a parser ColoriseLog in pkg/utils/logs.go to colorize common log levels (INFO, WARN, ERROR, DEBUG) and ISO timestamps using ANSI colors.
    • Wrapped stderr output in bold ANSI red to differentiate it from stdout stream data.
  2. Auto Mouse Capture Toggling (Drag to Copy):

    • When the main logs view focuses, mouse capture is automatically disabled (gocui.Screen.DisableMouse()) so users can immediately drag and select text for native copying.
    • Restores mouse capture automatically when focus leaves the main view to list panels.
    • Displays status info in the bottom panel (Mouse: OFF (Drag to copy)).
  3. External Pager Integration (l Key):

    • Binds l key inside logs, containers, and services views to suspend the TUI and launch an external log viewer/pager (defined in config.yml via logs.pager, default less -R).
    • Uses temporary file logging to pipe logs dynamically, avoiding terminal input conflicts/hangs.
  4. Korean Keyboard Layout Support:

    • Added a dynamic keybinding translation hook for Korean 2-Set (Dubeolsik) keyboard layout.
    • Duplicates English bindings at runtime for Korean character inputs (e.g. mapping to s and + Shift to S / Start) to ensure the application works seamlessly when the IME is set to Korean.

Testing

  • Added unit tests for log colorizing in pkg/utils/logs_test.go.
  • Added unit tests for keybinding translation mappings in pkg/gui/keybindings_test.go.
  • Verified all unit and integration tests pass successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant