Saltar al contenido

Esta página aún no está traducida. Se muestra en inglés.

Terminal surfaces

What elide test, build, help, serve and repl draw in a Tern terminal: inline blocks, full pages, --surface and ELIDE_TERN_SURFACE, and when plain output stays.

Experimental

Experimental
Esta función es experimental: sus comandos, opciones y salida pueden cambiar entre versiones. Informar de un problema

Leer sin conexiónelide help --lang es tern-terminal

En esta página

Nothing about your habits changes. You type elide test the way you always have; in a Tern terminal the results draw as a view instead of scrolling past as lines. Five commands behave this way, and none of them needs the plugin. The plugin’s part is to open the elide:// links the views carry (see Links).

CommandIn a Tern terminalPlain output kept for
elide testResults inline in the pane--reporter, --project, a glob or missing path, redirected output
elide buildThe build inline in the pane--inspect, --help, --progress, --project, redirected output, no elide.pkl
elide helpThe docs as a native page--format markdown, redirected output
elide serveThe Server page--no-tui, no terminal
elide replThe REPL inline in the panePiped or redirected input or output

Outside Tern every command prints as it does in any terminal. Scripts and other tools see the same text they always did: a pipe or a redirect, a non-terminal stdin or TERM=dumb is enough to get it. -p counts as --project, and -- on elide test keeps plain output too.

Inline and page surfaces

elide test and elide build draw inline by default: the view sits in the pane’s output, and when the command ends it stays in scrollback like printed text. A page takes the whole pane until you quit it.

SettingEffect
--surface=inlineDraw inline. The default.
--surface=screenOpen the full page.
--surface=autoSame as inline.
ELIDE_TERN_SURFACE=screenThe default mode for every run in that environment.

The flag wins over the variable. A flag value other than inline, screen or auto is an error. A variable naming no mode makes the run use auto; elide test also prints one warning on stderr:

text
elide: ELIDE_TERN_SURFACE='full' names no surface mode (expected inline, screen or auto); using auto
utf-8 · text · Lines: 1

A Tern without inline surfaces gets the page. Outside Tern, and on any run that keeps the plain output, --surface is accepted and has no effect, so scripts can always pass it. An inline view closes when its run finishes and the command returns; the keys below act on the pages.

elide test in Tern

LevelHow to get itWhat it shows
Plain textOutside Tern, or --reporterThe reporter’s lines.
Inlineelide test in a Tern terminalStatus, counts and the results table, with the selected test’s failure beneath.
Tests page--surface=screenResults, Failures, Output and Coverage tabs, with rerun and cancel.
Project Tests pageRun tests in the pluginThe Tests page on a shared project session, with Debug this test.

Plain text:

TernPlain test output0:07With a reporter, elide test prints plain output for other tools, such as TAP, in place of the inline surface.

Inline:

TernTests inline in the terminal0:06elide test in a Tern terminal draws live results inline: totals, each test's status and duration, and failures.

Project Tests page in the workspace:

TernThe Tests page0:09The workspace's Test button runs the project's tests on the full Tests page, with failure details, output and source links.

elide test exits nonzero when the last run failed, and 130 when a run is cancelled or interrupted before it finishes. Test files and failure locations inside a project link to the source editor.

KeyAction
Tab, ] / Shift+Tab, [Next and previous tab.
j k, ↑ ↓Select a test; on Coverage, a file.
rRun again.
cRun with coverage.
xCancel the run.
dDebug the selected test (project Tests page).
EscBack out one view.
q, Ctrl+DQuit from Results.

Tests run with the same flags as a plain run: --coverage, -t, --where and the other elide test flags pass through. Each run saves its TAP report and runner log under .dev/reports/tests/tern/ in the project, or in the test file’s directory outside one.

elide build in Tern

LevelHow to get itWhat it shows
Plain textOutside Tern, or a run that keeps plain outputThe build’s log lines.
Inlineelide build in a Tern terminalState, error and warning counts, task progress and a card per diagnostic.
Build page--surface=screen, or Build project in the workspaceThe same, full pane, with Rebuild (r).

Plain text:

TernCompiler errors as text0:09elide javac prints each compiler error as text, with its location and the source lines around it.

Inline:

TernBuilds inline in the terminal0:07elide build in a Tern terminal draws its Build surface inline: steps, timing and each diagnostic with its source excerpt.

Build page from the workspace:

TernBuild diagnostics in the source editor0:18The workspace's Build button opens the Build page; Open takes an error to the Elide source editor, which marks it in the gutter, underlines it and prints the message beside the line.

x cancels a running build; q, Esc and Ctrl+D close the page once the build has finished. elide build exits with the build’s own status, and 130 when it is cancelled or interrupted. Each run writes its diagnostics report, which the source editor and status bar read; see Build diagnostics.

elide help in Tern

LevelHow to get itWhat it shows
Plain textOutside TernThe terminal reader.
Help pageelide help in a Tern terminalNavigation beside the page, a trail to its group and a search field.

Plain text:

TernHelp as text0:07Piped, elide help prints a topic as Markdown text.

Help page:

TernThe help browser0:12elide help in Tern opens the documentation as a page: search the topics, open one and read it without leaving the terminal.

elide help TOPIC opens at that topic; elide help options and the other command-line topics print text. Under 80 columns the page stacks the search field, the page and the navigation. Keys and search: help. Links between help pages are elide://help?topic=<slug> URLs; through the plugin they open in a new pane beside the one you clicked in.

elide serve in Tern

LevelHow to get itWhat it shows
Plain text--no-tui, or no terminalPlain log output.
Terminal dashboardelide serve outside TernRequests, logs and metrics in the terminal.
Server pageelide serve in a Tern terminal, or Serve directory or scriptAddress, state, Requests, Traces and Logs tabs, Restart and Stop.
TernServe with a live dashboard0:12elide serve in a Tern terminal shows the bound URL, each request's status and latency, logs, and Stop and Restart.
KeyAction
Tab, ] / Shift+Tab, [Next and previous tab.
j k, ↑ ↓Select a request.
rRestart the server.
sStop the server.
pPause or resume trace capture.
eShow only failed traces (Traces); Esc shows all again.
cClear traces (Traces) or logs (Logs).
q, Esc, Ctrl+C, Ctrl+DQuit; the server stops.

A directory is served as static files; a script runs with its fetch handler, and elide dev on a script opens the same page. The Logs tab appears with the first log line and the Traces tab once a request is captured; see Traces.

elide repl in Tern

LevelHow to get itWhat it shows
Plain textelide repl outside TernThe terminal REPL.
Inline REPLelide repl in a Tern terminalA language picker, an editor, and results as they arrive.
NotebookOpen REPL in the pluginA notebook where JavaScript and Python share live values.
TernShared values across languages0:14In the Elide REPL, define a value in JavaScript, switch to Python with Ctrl+L and use it there: every language shares one notebook kernel.
KeyAction
EnterEvaluate.
Shift+Enter, Ctrl+JNew line.
Ctrl+LOpen the language picker; ↑ ↓ choose, Enter switches, Esc closes it.
↑ on the first line, then ↓Step through history.
TabComplete a / command.
Ctrl+CInterrupt an evaluation.
Ctrl+DQuit, on an empty editor.

Clear sends /clear. The REPL’s commands work inline and in the notebook. The notebook is described under REPL notebook.

Next

The views so far live in whatever terminal you typed in. The project workspace gives a project its own tab, with a toolbar that opens these same pages and test runs that every view shares.

See also

¿Te resultó útil esta página?