Switch to cmcaine's shell escape library

This commit is contained in:
Oliver Blanthorn 2019-06-15 12:46:23 +01:00
parent a71398dc1e
commit d129c47913
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
5 changed files with 18 additions and 73 deletions

View file

@ -1,5 +1,15 @@
# Tridactyl changelog
## Release 1.16.1 / 2019-06-15
- New features
- `;v` now escapes the hrefs you choose (see `get exaliases.mpvsafe` to see how it does it)
- Bug fixes
- `shellescape` will now actually properly escape stuff on Windows
## Release 1.16.0 / 2019-06-14
- New features

View file

@ -13,7 +13,6 @@
"immer": "^3.1.3",
"mark.js": "^8.11.1",
"mithril": "^1.1.6",
"node-shell-quote": "git://github.com/dy/node-shell-quote",
"rss-parser": "^3.7.1",
"semver-compare": "^1.0.0"
},

View file

@ -89,12 +89,6 @@ import * as TTS from "@src/lib/text_to_speech"
import * as excmd_parser from "@src/parsers/exmode"
import * as escape from "@src/lib/escape"
// cmcaine: I have my doubts about this library.
// Before using it, work out if it does do what you want.
// The escape library I wrote above may be better.
import * as shell_quote from "node-shell-quote"
export const quote = shell_quote
/**
* This is used to drive some excmd handling in `composite`.
*
@ -2720,7 +2714,13 @@ export async function composite(...cmds: string[]) {
* Escape command for safe use in shell with composite. E.g: `composite js MALICIOUS_WEBSITE_FUNCTION() | shellescape | exclaim ls`
*/
export async function shellescape(...quoteme: string[]) {
return shell_quote.quote(quoteme)
const str = quoteme.join(" ")
const os = (await browserBg.runtime.getPlatformInfo()).os
if (os === "win") {
return escape.windows_cmd(str)
} else {
return escape.sh(str)
}
}
/** Sleep time_ms milliseconds.

View file

@ -10,62 +10,7 @@ Tridactyl has to override your new tab page due to WebExtension limitations. You
- Upcoming **userChrome.css** changes: Mozilla is going to require a preference to be set to true from Firefox 68 to read userChrome. See [this issue](https://github.com/tridactyl/tridactyl/issues/1572).
- **Tridactyl retreat** 👀: 4 of the core Tridactyl developers met up in the real world to work on Tridactyl from 24th May - 1st June in the Peak District, UK. [Donate using this link](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7JQHV4N2YZCTY) if you'd like to contribute to our travel, accommodation and subsistence costs, which costed about £2,300. As of June 3rd, we have so far raised ~£800, so thanks to all of you who have donated.
- Tridactyl retreat dev diary:
- Day -1: Azk arrives; cmcaine, bovine3dom, azk go for a curry, have an accidental pilgrimage to Stephenson's Rocket, and trek to the Peak District.
- Day 0: cmcaine & bovine3dom went for a walk. Azk did some work. glacambre arrived. Hugh Jackman visits Piccadilly Gardens the day after us, proving once again our trend-setting abilities.
- Day 1:
- We all looked at the most-thumbed-up issues to help organise our priorities and thumbed our noses at them; our main aim for the retreat is to reduce jank and have a more consistent UX
- cmcaine worked on a functional version of Tridactyl's state considering immutable.js, meoisis, and immer.js [link](https://github.com/cmcaine/tridactyl-2-experiments)
- azk discovered that hiding our iframe in a shadow DOM doesn't solve the page-refresh-loop bug. azk then ran some experiments with MithrilJS and began reimplementing the commandline
- bovine3dom started looking through the backlog of issues, closing a few, updating others
- We moved the keyboard API to the Tridactyl organisation; bovine3dom started rewriting it to comply with the current WebExtension experiment requirements
- The plan is to first make a Firefox Developer Edition only Tridactyl build that comes with the keyboard API to prevent us getting bored of waiting for Mozilla (and vice versa)
- But the WebExtension Experiment API has changed enough that we're currently in build-tool hell with the keyboard-api
- glacambre fixed a bunch of issues with scrolling and focusing events, thanks glacambre!
- Day 2:
- azk and cmcaine continued work on the commandline and state redesign based off saulrh's earlier work. The current focus is on getting the CLI up and running, making the statusbar work and defining the states and the RPC communication between them.
- bovine3dom went over old issues, fixing some, closing others, and accepting a few PRs. He also bashed his head against WebExtension Experiments for the keyboard API but didn't make any progress.
- glacambre fixed some issues from the backlog and started work on turning hintmode into a real mode with user-configurable binds.
- Day 3:
- azk, cmcaine and saulrh continued work on the commandline/state redesign. cmcaine wrote some RPC stuff he was happy with. saulrh got Mithril working with iframes.
- bovine3dom closed/fixed some more issues and made it harder to add undocumented config settings.
- glacambre finished hint mode and got it merged; he also fixed our find mode up a little bit.
- All of us went out for a curry, partially subsidised by our donors - so thanks!
- Day 4:
- azk and cmcaine got an input box working in an iframe under Mithril. They're confident that they'll be able to get a little bit of Tridactyl working with it soon.
- bovine3dom kept working through the backlog, closing duplicate issues and fixing easy ones. Particularly, error messages will no longer steal focus from the page.
- bovine3dom and cmcaine looked at the keyboard API again; we've changed a few things and now we get different error messages.
- In total, we closed 27 issues today.
- glacambre worked on find mode to the point where it's quite useable now; he's also been experimenting with new ways of doing ex-commands such that they can be created at runtime.
- Day 5:
- azk, cmcaine kept working on the iframe / commandline
- bovine3dom kept working through the backlog, closing duplicate issues and fixing easy ones. He also added `keyfeed` and user-definable modes.
- glacambre fixed smooth scrolling a bit, and made find mode a little better.
- In total, we closed 4 issues today (but they were harder :()
- nmx nqqrq ebg13 naq grkg.ebg13
- bound to `g?` by default; text mode version is not bound.
- glacambre, cmcaine and bovine3dom went for a walk up Higger Tor.
- Day 6:
- glacambre made some progress towards allowing us to remove our python macro script, replacing it with the TypeScript compiler
- glacambre fixed the find mode up a little more; it now focuses elements you select with it amongst other things
- bovine3dom added some kind of rudimentary version checking to `nativeinstall` to allow us to make breaking changes to the native messenger without breaking all old versions of Tridactyl forever - untested on Windows, so please poke us if it seems to be broken
- cmcaine fixed and broke numeric prefixes an odd number of times
- cmcaine swapped npm out for yarn as we were all fed up of npm making random changes to package-lock.json
- antonva looked at the keyboard-api and WebExtension experiments and got nowhere (like the rest of us :( )
- All of us went out for a Chinese meal - again subsidised by donors, so thanks!
- Day 7:
- glacambre left :(
- antonva fixed up and finished `mktridactylrc`
- bovine3dom investigated `keyup` binds and TreeStyleTab integration and opened draft PRs for both
- cmcaine played with iframes and the shadow DOM some more
- Day 8 - the final day:
- antonva left :(
- antonva fixed `set findcase smart` after leaving
- bovine3dom merged `:mktridactylrc`
- bovine3dom started to make a Sankey diagram accounting the funding and costs of the retreat for funsies
- **Tridactyl retreat** 👀: 4 of the core Tridactyl developers met up in the real world to work on Tridactyl from 24th May - 1st June in the Peak District, UK. [Donate using this link](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7JQHV4N2YZCTY) if you'd like to contribute to our travel, accommodation and subsistence costs, which costed about £2,300. As of June 15th, we have so far raised ~£900, so thanks to all of you who have donated.
* If Tridactyl breaks a website or is broken by a website, trying the steps in the [troubleshooting guide](https://github.com/tridactyl/tridactyl/blob/master/doc/troubleshooting.md) might help.

View file

@ -5368,15 +5368,6 @@ node-pre-gyp@^0.10.0:
semver "^5.3.0"
tar "^4"
"node-shell-quote@git://github.com/dy/node-shell-quote":
version "1.6.1"
resolved "git://github.com/dy/node-shell-quote.git#daa9d313adb29edd3e2354d409078c9bb283127e"
dependencies:
array-filter "~0.0.0"
array-map "~0.0.0"
array-reduce "~0.0.0"
jsonify "~0.0.0"
node-status-codes@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/node-status-codes/-/node-status-codes-1.0.0.tgz#5ae5541d024645d32a58fcddc9ceecea7ae3ac2f"