This allows us to write the rc to OS. The only way to overwrite your current
rc file is to use mkt!, mktridactylrc! or mktridactylrc -f. mkt* commands
issued without the force/exclamation mark will not overwrite existing files.
Native messenger was updated to 0.1.11 and the mktridactylrc command is
unavailable in prior versions.
Fixed some random indentation errors that occurred in earlier commit.
https://github.com/tridactyl/tridactyl/issues/1099 happened because of a
misconfigured $XDG_DATA_DIR. This could have been caught by checking
that the manifest and the messenger actually exist. This commit adds
these checks.
Closes#1099.
This commit adds a `:saveas` ex command that behaves mostly like
pentadactyl's `saveas`. This requires adding a new `move` primitive to
the native messenger which behaves like `cp` (but isn't actually a call
to `cp` in order to stay compatible with windows). Then
native_background.ts uses that in order to move files when their
download is complete.
Handle FreeBSD's OSTYPE (which has "freebsdX.Y" format). While here,
convert OSTYPE check to use 'case' instead of if's/elif's.
For unknown OSTYPE fallback to the default Linux location.
There's currently no way to tell the native messenger to
provide a particular stdin to a "run" command. This leads to
awkward uses of here-docs, which in turn require hacks like
the one in 4a5dcd7557.
Instead, let's take the "content" field from the message
body and feed that to the command's stdin, which gives us a
more robust channel for passing arbitrary bytes.
Note that we have to switch to using subprocess.Popen's
communicate() method, which will make sure we don't deadlock
if the input or output exceeds a pipe buffer.
Note also that when no stdin is provided by the caller
(i.e., all current cases), we'll pass an empty string. This
actually fixes a minor bug. Because we didn't override the
command's stdin argument, it's hooked to the messenger's
stdin, which is the pipe coming from firefox. If the command
tries to read, it (and the messenger) will hang forever,
since firefox is waiting for the messenger to respond before
writing anything else.
I bumped the native messenger version. This is mostly
backwards compatible (existing callers just don't send any
stdin content at all). But a caller that wants to send stdin
should check to make sure we have at least 0.1.7.
This makes debugging work correctly on Linux. Otherwise
you'll generally get EPERM as `/home/user\.tridactyl` is a
path in `/home`, which you likely don't have access to
write.