Leo’s Console Gui

This chapter describes Leo’s console gui. This allows Leo to be run remotely.

Here is a screen shot:

ConsoleWindow

The area between colons in the Tree pane corresponds to Leo’s icon box:

+:    : node has unexpanded children.
-:    : node is expanded.
 :    : node has no children.
 '*   : node is the selected node.
 : C  : node is a clone.
 :  M : node is marked.
 :   T: node has body text.

System requirements

Leo’s Console minimal dependencies are:

  • Python 2.6 or later, including all Python 3.x versions.
  • Curses

For windows, download and install curses from this page and then install using pip.

Starting Leo with the console gui

  1. Resize your console/terminal to a recommended minimum size of 100x35. Leo will crash on startup if there are fewer than 32 rows.

  2. Launch Leo with the –gui=console command-line option:

    >launchleo.py --gui=console [path to leo file\file_name.leo]
    

If no .leo file is given, Leo will open ~/.leo/workbook.leo (Leo’s workbook file). Initially, this file contains Leo’s cheat sheet and an example from the rst3 tutorial.

Only one outline can be open at a time. The only way to load .leo files is from the command line. (There are no menus).

Exiting Leo & saving files

To exit Leo: click “Quit Leo” button and <Enter>. Ctrl-Q also works. There is no way to cancel Ctrl-Q. A dialog box will appear. Press Enter to select “No”. Press arrow keys to move between “Yes” and “No”. “Yes” saves, then exits. “No” Exits without saving.

Leo key bindings

Supported Ctrl commands:

Ctrl-B (execute-script).
Ctrl-F (find)
Ctrl-Q (quit-leo)
Ctrl-S (save) Works for windows cmd.exe, but not Consolez.

Unsupported Ctrl commands:

Alt-S,
Ctrl-Shift-S
Ctrl-O
Shift arrows

Broadcast and Listening

The console gui can broadcast print statements and traces to another console. To do this, you must start a socket listener in the other console, listening to the broadcaster on localhost:

Leo Qt (listener) <-- Leo console, (broadcaster)

To set this up:

  • In the listener console, start a regular Leo Qt session.
  • Start the listener with the ‘listen-to-log’ command.
  • In the broadcast console, start Leo with the console gui. This starts the broadcaster.
  • Leo’s log output will be displayed in the Leo Qt session console.
  • The ‘kill-log-listener’ command kills the listener, if it exists. Issue this command in the Leo Qt session.

Limitations

Cut/paste is theoretically supported, but in the absence of selections only paste might work. And paste may work only in limited contexts...

Some commands can be run from the minibuffer, but there is no tab completion and no indication of what the correct command names are.