User Guide

See also

This guide can be viewed online at: https://pigweed.dev/pw_console/

The Pigweed Console provides a Python repl (read eval print loop) and log viewer in a single-window terminal based interface.

Starting the Console

pw rpc -s localhost:33000 --proto-globs pw_rpc/echo.proto

Exiting

  1. Click the [File] menu and then Exit.

  2. Type quit or exit in the Python Input window and press Enter.

Interface Layout

On startup the console will display multiple windows one on top of the other.

+-----------------------------------------------------+
| [File] [View] [Window] [Help]       Pigweed Console |
+=====================================================+
|                                                     |
|                                                     |
|                                                     |
| Log Window                                          |
+=====================================================+
|                                                     |
|                                                     |
| Python Results                                      |
+- - - - - - - - - - - - - - - - - - - - - - - - - - -+
|                                                     |
| Python Input                                        |
+-----------------------------------------------------+

Color Depth

Some terminals support full 24-bit color and pw console will use that by default in most cases. One notable exeception is Apple Terminal on MacOS which supports 256 colors only. iTerm2 is a good MacOS alternative that supports 24-bit colors.

To force a particular color depth: set one of these environment variables before launching the console. For bash and zsh shells you can use the export command.

# 1 bit | Black and white
export PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_1_BIT
# 4 bit | ANSI colors
export PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_4_BIT
# 8 bit | 256 colors
export PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_8_BIT
# 24 bit | True colors
export PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_24_BIT

For Windows command prompt (cmd.exe) use the set command:

set PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_1_BIT
set PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_4_BIT
set PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_8_BIT
set PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_24_BIT

Known Issues

Log Window

Upcoming Features

For upcoming features see the Pigweed Console Bug Hotlist at: https://bugs.chromium.org/u/542633886/hotlists/Console