Closed
Bug 786661
Opened 14 years ago
Closed 13 years ago
GCLI should not auto-unescape command line escapes
Categories
(DevTools Graveyard :: Graphic Commandline and Toolbar, defect, P2)
DevTools Graveyard
Graphic Commandline and Toolbar
Tracking
(Not tracked)
RESOLVED
FIXED
Future
People
(Reporter: jwalker, Assigned: jwalker)
References
Details
Attachments
(1 file, 5 obsolete files)
|
32.19 KB,
patch
|
harth
:
review+
|
Details | Diff | Splinter Review |
>> pref set foo.dir c:\nice
| Assignee | ||
Updated•14 years ago
|
Priority: -- → P2
Target Milestone: --- → Future
Updated•14 years ago
|
Assignee: nobody → ravicat2013
Status: NEW → ASSIGNED
Comment 1•14 years ago
|
||
hii joe
i have a small doubt. GCLI should not bother about any of the escape characters is it ??.
or should it consider escape characters like "\r" and ignore "\\r"....
Thanks
Comment 2•14 years ago
|
||
Attachment #656787 -
Flags: review?(jwalker)
| Assignee | ||
Comment 3•14 years ago
|
||
Thanks for this.
I'll take a look at this, but I need to test it out and play with it for a while, and consider the wider effects of the change, which could take me a while.
A good place to look for good things to work on is this list: https://bugzilla.mozilla.org/buglist.cgi?cmdtype=runnamed;namedcmd=GCLI%20Good%20First%20Bugs;list_id=4220155
Thanks.
Comment 4•14 years ago
|
||
the link u have given is broken .... can u pls provide it again
thanks
| Assignee | ||
Comment 6•13 years ago
|
||
New component triage. Filter on "Lobster Thermidor aux crevettes with a Mornay sauce"
Component: Developer Tools: Console → Developer Tools: Graphic Commandline and Toolbar
| Assignee | ||
Updated•13 years ago
|
Attachment #656787 -
Flags: review?(jwalker)
Comment 8•13 years ago
|
||
Turns out that we were converting to real values of \t or \f too early. Now I check if there is no \\ before f before converting to real, and similarly for other values too.
But there is still no way to do this: ( and I am unable to think of such a way)
1) Let there be a command X with 2 arguments .
2) Pass the first argument as 'a\b\c\' and second argument as 'xyz' (anything), both without quotes
Basically, you would have to do :
>> X a\\b\\c\\ xyz
but this would be considered as a single argument of 'a\b\c xyz'
Attachment #656787 -
Attachment is obsolete: true
Attachment #748473 -
Flags: review?(jwalker)
| Assignee | ||
Comment 9•13 years ago
|
||
Attachment #748473 -
Attachment is obsolete: true
Attachment #748473 -
Flags: review?(jwalker)
Attachment #748766 -
Flags: feedback?(scrapmachines)
| Assignee | ||
Comment 10•13 years ago
|
||
From IRC:
11:20 jwalker: there are 2 distinct reasons for escaping:
11:20 jwalker: 1. allow typing untypable chars (\t, \n, etc)
11:20 jwalker: 2. preventing gcli from treating chars like ', ", [space], {, } as special
11:21 jwalker: so the tokenizer needs to think about 2, but not 1
11:21 jwalker: 1 should be handled by the type system
11:21 jwalker: just as we convert "42" to 42 when the type is a number
11:21 jwalker: so we should convert "\t" to a TAB char when the type is a string
| Assignee | ||
Comment 11•13 years ago
|
||
This patch also tweaks some tests that had wrongly ordered is params. For now, we only need to think about the changes to gcli.jsm
Comment 12•13 years ago
|
||
Comment on attachment 748766 [details] [diff] [review]
v0.3
Review of attachment 748766 [details] [diff] [review]:
-----------------------------------------------------------------
So I made an echo command and tried it (http://pastebin.mozilla.org/2400500)
Here are few inputs that I tried, followed by actual and expected:
>> echo a\\ b c
Actual output : a\\,b,c
Expected: a\,b,c
>> echo a\ b c d
Actual output: as soon as I finish typing 'a\ ', gcli converts it to 'a ' and when I am done typing 'd', gcli just says that extra argument provided and does not do anything on enter.
Expected: a b,c,d
When you said that gcli should take the input as is, shouldn't escaping characters still be valid ? like when I do alert("a\\ b") , the alert popup says "a\ b" (without quotes) . Shouldn't the same apply here ?
Attachment #748766 -
Flags: feedback?(scrapmachines)
| Assignee | ||
Comment 13•13 years ago
|
||
Updated to fix the problems you found, plus I've added unit tests for your issues.
Assignee: ravicat2013 → jwalker
Attachment #748766 -
Attachment is obsolete: true
Attachment #749164 -
Flags: feedback?(scrapmachines)
| Assignee | ||
Comment 14•13 years ago
|
||
Comment 15•13 years ago
|
||
Comment on attachment 749164 [details] [diff] [review]
v4
Review of attachment 749164 [details] [diff] [review]:
-----------------------------------------------------------------
It fixes the problem I mentioned ("a\", "b", "c") vs ("a b", "c", "d") but it created a new issue :
using the same echo command in http://pastebin.mozilla.org/2403647
try:
>> echo abc\\ndef asd asd
Expected output: [abc\ndef, asd, asd]
Actual output:
[abc
def, asd, asd]
Basically, while it does not converts \\x to its real value while typing (where x = r, f, n, etc). It first makes \\ into \ and then renders \n as new line character.
Attachment #749164 -
Flags: feedback?(scrapmachines)
| Assignee | ||
Comment 16•13 years ago
|
||
Good spot on the double decoding - I've added a test for that case. How does it work now?
Attachment #749164 -
Attachment is obsolete: true
Attachment #750412 -
Flags: feedback?(scrapmachines)
| Assignee | ||
Comment 17•13 years ago
|
||
Comment on attachment 750412 [details] [diff] [review]
v5
Adding harth as a reviewer, but she'd probably like to know Optimizers thoughts on this in her review.
Attachment #750412 -
Flags: review?(fayearthur)
Comment 18•13 years ago
|
||
My bad for delaying. I will get to this within 2 hours.
Comment 19•13 years ago
|
||
Comment on attachment 750412 [details] [diff] [review]
v5
Review of attachment 750412 [details] [diff] [review]:
-----------------------------------------------------------------
Everything works fine now, except for this little minor case, that I could not see why it fails :
>> echo f:\\fx-team\\ a\ b\ m\\ a\ b\\
Output: f:\fx-team,a b m\,a b\
Expected : f:\fx-team\,a b m\,a b\
I am confused as to why the second and the third argument did not get the character. Everything is same. :|
f+ with that fixed.
Attachment #750412 -
Flags: feedback?(scrapmachines)
| Assignee | ||
Comment 20•13 years ago
|
||
Fixes the latest problem, which was due to a missing /g
Has had f+ from Optimizer.
Attachment #750412 -
Attachment is obsolete: true
Attachment #750412 -
Flags: review?(fayearthur)
Attachment #751385 -
Flags: review?(fayearthur)
| Assignee | ||
Comment 21•13 years ago
|
||
Updated•13 years ago
|
Attachment #751385 -
Flags: review?(fayearthur) → review+
| Assignee | ||
Comment 22•13 years ago
|
||
https://tbpl.mozilla.org/?tree=Fx-Team&rev=6cf5ac92530b
https://hg.mozilla.org/integration/fx-team/rev/e353f92a63bd
Whiteboard: [fixed-in-fx-team]
Comment 23•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Updated•8 years ago
|
Product: Firefox → DevTools
Updated•8 years ago
|
Product: DevTools → DevTools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•