Open the terminal
You can open the terminal on its own or next to a project’s code.- On its own
- Inside a project
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.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”.
Built-in commands
Typehelp 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
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
Thegit 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 with2>and2>&1. - Chaining: run commands in order with
;, only after success with&&, or only after failure with||. - Wildcards:
*,?, and[a-z]match file names. - Variables:
$NAMEand${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.
&), 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, andlesssay “command not found”. - Developer tools such as
node,npm,make,docker,gcc, andjavaaren’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, orunsetcommand in the local shell.
Troubleshooting
“command not found”
“command not found”
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.“not available in the local iPad runtime”
“not available in the local iPad runtime”
The tool, such as
npm or make, can’t run on an iPad. Use ssh to run it on another computer.“outside the app sandbox”
“outside the app sandbox”
The path points outside Lectra’s storage. Work inside your home folder (
~).I deleted a file by mistake
I deleted a file by mistake
Type
trash to list deleted files, and then type trash restore followed by the file’s number or name.nano doesn't open anything
nano doesn't open anything
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.Related
Run Python
Run Python on your iPad without an internet connection.
Use Git
Clone, commit, and push from your iPad.