Skip to main content
Lectra includes a terminal: a text window where you type commands to work with files, run Python, and use Git, all on your iPad. It’s built for Lectra, so it has its own set of commands rather than a full Linux or macOS system. If you need tools that Lectra doesn’t include, you can connect to another computer over SSH.

Open the terminal

You can open the terminal on its own or next to a project’s code.
1

Go to Projects

In your library, tap Projects.
2

Open the New menu

Tap New.
3

Choose Terminal

Tap Terminal. The terminal opens full screen, in your Projects folder.
The first line says “Lectra terminal — type help for commands.” Type a command, and then press Return. To close the full-screen terminal, tap Close Terminal (the × in the header). Your tabs come back when you open it again, until Lectra quits.

Work with tabs

Each tab is named after the folder it’s in. Closing the last tab closes the terminal.

Where your files are

The terminal sees Lectra’s own storage on your iPad. Your home folder (~) contains: Names with spaces show with underscores instead, such as Lecture_3. You can’t leave Lectra’s storage. A command that tries says “outside the app sandbox”.
Do your work inside Projects. To open a library document or notebook from the terminal, use open, for example open notebooks/My_Notes.ipynb.

Built-in commands

Type help to see a summary in the terminal. The following tables list every command.

Files and folders

Read and search text

Open and edit

Shell and settings

To set up aliases or variables for every new tab, put the commands in a file named .lectrarc in your home folder. Lectra runs it each time you open a tab.

Python

Files that a Python script creates aren’t saved to your folders. To learn which packages are included and what Python can do on your iPad, see Run Python.

Git

The git command works with repositories in your Projects folder. It supports these subcommands: init, clone, add, rm, status, commit, log, branch, tag, show, checkout, switch, restore, diff, fetch, pull, push, remote, config, rev-parse, and version. For what each one supports, how to sign in to GitHub, and the limits, see Use Git.

Remote computers

Combine commands

The terminal supports the following:
  • Pipes: send one command’s output to another, such as ls | grep .py.
  • Redirection: save output with > or append with >>, and read input with <. You can also redirect errors with 2> and 2>&1.
  • Chaining: run commands in order with ;, only after success with &&, or only after failure with ||.
  • Wildcards: *, ?, and [a-z] match file names.
  • Variables: $NAME and ${NAME}. $? is the result of the last command.
  • Command substitution: $(command) puts one command’s output into another.
  • Quotes: single quotes, double quotes, and \ work as in other shells.
The terminal doesn’t support background jobs (&), if, for, or while statements, functions, or brace expansion such as {a,b}.

Use the keyboard

These keys need a hardware keyboard. The terminal has no extra key row on the on-screen keyboard, except during an SSH session. To copy output, select it and copy it. When you paste, line breaks become spaces, because the terminal takes one line at a time.

Connect to another computer with SSH

Use SSH when you need tools that Lectra doesn’t include, such as compilers or Node.js.
1

Start the connection

Type ssh user@host, replacing user with your account name and host with the computer’s address. Add -p 2222 if the computer uses another port.
2

Enter your password

At Password for user@host:, type your password, and then press Return. The password doesn’t show as you type.
3

Work on the remote computer

The header shows SSH and the computer’s address. A key row above the on-screen keyboard adds esc, ctrl, Tab, arrows, and other keys.
4

Disconnect

Tap Disconnect in the header, or type exit.
SSH in Lectra supports password sign-in only. The first time you connect to a computer, Lectra trusts it and remembers it. If that computer’s identity changes later, Lectra refuses to connect and says “Host key changed”.

Limits

  • The terminal runs one command at a time. Control C doesn’t stop a long-running command.
  • Commands that aren’t listed on this page aren’t available. For example, sed, awk, curl, tar, chmod, and less say “command not found”.
  • Developer tools such as node, npm, make, docker, gcc, and java aren’t available on the iPad. The terminal tells you to use SSH instead.
  • Some Git features aren’t available, including rebase, stash, submodules, and SSH remotes. To learn more, see Use Git.
  • There’s no exit, history, or unset command in the local shell.

Troubleshooting

The command isn’t built into Lectra’s terminal. Check the tables on this page. If you need the tool, connect to a computer that has it with ssh.
The tool, such as npm or make, can’t run on an iPad. Use ssh to run it on another computer.
The path points outside Lectra’s storage. Work inside your home folder (~).
Type trash to list deleted files, and then type trash restore followed by the file’s number or name.
nano, vi, and vim open files only from a project’s terminal panel. Open the project first, and then open its terminal. To learn more, see Use the code editor.

Run Python

Run Python on your iPad without an internet connection.

Use Git

Clone, commit, and push from your iPad.