Commit Graph

6 Commits

Author SHA1 Message Date
Anthony DiGirolamo
abe736a5f3 pw_console: Copy Python input text to clipboard
Also unify ctrl-c behavior as cancel for python input and log windows.

Pressing ctrl-c in the python input will:
- NEW: If text is highlighted, copy that text to the clipboard.
- If no selection, clear the input.
- If no text is entered, try canceling the last running command.

Pressing ctrl-c in the log window will:
- NEW: Clear any active log selection
- NEW: Close the search bar (was Ctrl-l)

Manual Tests: Copy Paste + Log Pane Search and Filtering

Change-Id: I663eede9b25d2836b99a5e6e0aa255407d8230f9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/87080
Reviewed-by: Chad Norvell <chadnorvell@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
2022-03-08 15:58:56 +00:00
Anthony DiGirolamo
b91d43a0c1 pw_console: LogView variable rename
Rename `line_index` variables and functions in log_view.py to
`log_index`. They are indexes of log messages in the LogStore;
not indexes of screen lines.

Bugfix: LogView clear history was not honored in the LogScreen class.

Change-Id: Ie050cc0e70faa7fdd897b53d44e4cb0f558e4156
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/82183
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
2022-02-02 02:24:04 +00:00
Anthony DiGirolamo
48f38663df pw_console: LogPane Render refactor
- Rewrite all log line rendering
- Supports displaying log lines that have line breaks
- Impemented word wrapping
- User initiated scrolling is done on a subline basis
- Log line follow mode will jump to the bottom of each new message so
  the whole log is displayed; just like on a standard terminal.
- Conditional rendering, logs are only re-rendered if needed. New lines
  are added incrementally instead of whole screen redraws.
- Horizontal scrolling left and right (when line wrapping is off) is
  not implemented. Those key bindings were removed for now.

Other changes:

- Default UI color changes: brighten the default foreground color and
  the selected log line.
- Menu option to hide date from log table view
- Allow hiding window plugins on startup
- Disable line wrap indentation size calculations

Manual test steps:
- All LogPane Basic Actions
- All LogPane Search and Filtering

Change-Id: Ifd9a82600b2e4a2463bf26a91091ad77cddfd917
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/81340
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
2022-02-02 02:20:48 +00:00
Anthony DiGirolamo
5a4324f666 pw_console: Open any Python logger interactively
- File > Open Logger menu that displays all known python loggers.
  Clicking one opens a new log window with that logger.

- File > Log Table View > Show Python File and Logger options.
  These preferences toggle displaying each log line's
  Python logger and file:linenumber columns in table view.

- Set logging.lastResort to a file handler. This prevent loggers
  with no handlers from outputting text to stderr and corrupting
  the prompt_toolkit UI.

Change-Id: I6f36384764621b0f62ad6c51687b5b125c91da44
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/69280
Reviewed-by: Joe Ethier <jethier@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
2021-12-04 16:57:54 +00:00
Anthony DiGirolamo
5c653f6983 pw_console: Config file loading; table settings
Working config settings:
- spaces_between_columns
- column_order
- column_colors

Change-Id: I6cb7140fa01e069353c2cb91eec74cd6d96b36b3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/62920
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2021-10-02 00:34:25 +00:00
Anthony DiGirolamo
a507b3622c pw_console: Refactor log pane classes
- Refactor log_container.py into log_view and log_store
- Move LogPane toolbar classes into log_pane_toolbars.py
- Add new tests for LogView and LogStore.

No-Docs-Update-Reason: Refactoring
Change-Id: I5187f9638558ea4ef7f0dc609cb2444201d4d028
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/52440
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2021-07-15 02:14:53 +00:00