Zum Inhalt springen
#0318
Terminal

The vim exam grades the screen, not the file

A shell-skills course has a problem: the output file proves the student got there, not how. Did they use a pipe or open the file in a GUI and hand-edit it? Did they learn :wq or copy-paste?

hoody-terminal keeps a server-side parser that mirrors the student's xterm.js screen. The grading script GETs /api/v1/terminal/snapshot and /api/v1/terminal/find with a regex against the rendered screen and scrollback. It can POST /api/v1/terminal/wait until a pattern appears: a vim title bar, a grep | sort | uniq -c chain, a tmux status line. What the script sees is what the student saw.

Exercise 4 passes when find matches sort.*\|.*uniq in scrollback and the result file hashes correctly. Both, not either.

A rendered terminal is an HTTP resource, so a shell skill becomes gradable.