Open schoeke opened 8 years ago
Hi, I considered letting "paths" through, but decided against it because it could be a misspelled command, which we want to avoid.
Slightly related PR + issue here:
I don't see an immediately clean solution for this (except to change the command prefix), but we could do something like looking for ^/[^ ]+/[^ ]+/
(at least three /
characters without spaces in between. This would "solve" your issue for most paths, but I'm not sure if this is too hacky. I guess this is politics. @hannesm ?
just write a space in front of the path... yes, it is annoying, but this is in-band signalling... (and no, regular expressions won't be included in jackline).. counting non-/ chars between multiple / chars could work (I've to sleep about that)...
How about escaping \/
at the start of a input line as /
(and \\
as \
)?
is it worth it? how often do you need to send /
at the beginning of a line?
From cli/cli_input.ml
:
String.get input 0 = '/'
(* copy-paste: treat as text if line starts with "/*" or "// " *)
&& not String.(length input >= 2 && get input 1 = '*')
&& not String.(length input >= 3 && sub input 1 2 = "/ ")
&& not String.(length input >= 3 && sub input 1 2 = "me")
--> //
and /*
(and /me
) are already supported... everything else is considered to be a command...
Not really that often, and most of the time using a dot or a space is fine. (Also this approach does not help you pasting a list of paths or likewise).
I find that the only time I want to paste stuff with /
, I'm pasting code.
At that point it might be nicer to implement something like the shell script here-document.
How about something like:
/uninterpreted <<EOFMARKER
To see your OTR fingerprint, do:
/fingerprint
EOFMARKER
seems to be fixed for /*
and //
in https://github.com/hannesm/jackline/commit/e06a555ab34a9f8cb0cace7c222616365726304a
Wanted to send a file path, didn't go through.
Not a major bug, just annoying. ;)