v1.10.2
Resterm now picks the file type itself and opens only reconized types.
If you are on 1.9.x
- 1.10.0 adds
cmd=for command auth and named command auth withuse=. Options with spaces around=and unknown@auth commandoptions are now errors. The Headers tab has a one-line summary and shows each repeated header on its own line. - 1.10.1 names a command auth definition with
name=, as in# @auth global command name=gh cmd="gh auth token". A plain word aftercommandis now an error, because in 1.10.0 it could turn off auth without an error.
Open in external app
In previous versions, the extension came from the file name the server sent or the URL. A body sent with filename="setup.exe" was written as resterm-2849.exe and handed to the default app. On Windows, this could e.g., run a program sent by the server. HTML and SVG bodies opened in the browser, where their scripts could run.
Now the extension always comes from the type. This body opens as invoice.pdf:
Content-Type: application/pdf
Content-Disposition: attachment; filename="invoice.exe"
- Resterm finds the type from the
Content-Typeheader, then the file name the server sent, then the body itself. - Only these types open: images, PDF, plain text, JSON, YAML, CSV, audio, video, zip and gzip archives, and Office files without macros (
.docx,.xlsx,.pptx). - HTML, SVG, XML, and Markdown open as
.txt, so scripts inside them cannot run. - When a type is not known, nothing opens and the status bar shows
Can't pick a safe app for this body. Save it with g Shift+S.
Opened files:
- Files keep the server's name, so the TUI shows
invoice.pdfinstead ofresterm-2849.pdf. - Files go to a private temp folder that Resterm deletes when it exits. In 1.10.1, they stayed in the system temp folder.
- Resterm waits for the opener, so it no longer leaves any processes behind. If the opener fails right away, the status bar shows the error and points to
g Shift+S(save to file). - The response command bar shows
Opennext toSaveon the Pretty and Raw tabs.
Save names
The name suggested by g Shift+S also changed:
- Common types get their usual extension.
audio/mpegsaves as.mp3, and+jsonand+xmltypes such asapplication/problem+jsonsave as.jsonand.xml. - A name that Windows treats as a device, such as
CON,AUX,NUL, orCOM1, gets a_prefix.CON.pdfsaves as_CON.pdf. Opened files get the same prefix.
Changed
g Shift+Eno longer opens executables, Office files that can hold macros (.doc,.xls,.ppt), or bodies with no known type. Save them withg Shift+Sand open them yourself.