interpreting near simultaneous Enter and backslash keys
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I typed an mv
command and intended to hit the Enter
key. Perhaps I hit the backslash key at almost the same time. If the Enter
key was first, the new line with the green prompt should appear to the left of (before) the backslash. Instead the backslash is to the left of the green prompt.
There is second backslash and perhaps it starts an escape sequence. Why did the color of the prompt change to white when my usual prompt color is green? I am not sure if I typed the second backslash or if it is somehow an "erroneous second echo".
The file move happened successfully but this inquiry is just to check that no extraneous files were created in strange places. "Move" implies that one file will be moved to one place so it seems there will not be an extraneous file created.
command-line escape-characters
add a comment |Â
up vote
0
down vote
favorite
I typed an mv
command and intended to hit the Enter
key. Perhaps I hit the backslash key at almost the same time. If the Enter
key was first, the new line with the green prompt should appear to the left of (before) the backslash. Instead the backslash is to the left of the green prompt.
There is second backslash and perhaps it starts an escape sequence. Why did the color of the prompt change to white when my usual prompt color is green? I am not sure if I typed the second backslash or if it is somehow an "erroneous second echo".
The file move happened successfully but this inquiry is just to check that no extraneous files were created in strange places. "Move" implies that one file will be moved to one place so it seems there will not be an extraneous file created.
command-line escape-characters
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I typed an mv
command and intended to hit the Enter
key. Perhaps I hit the backslash key at almost the same time. If the Enter
key was first, the new line with the green prompt should appear to the left of (before) the backslash. Instead the backslash is to the left of the green prompt.
There is second backslash and perhaps it starts an escape sequence. Why did the color of the prompt change to white when my usual prompt color is green? I am not sure if I typed the second backslash or if it is somehow an "erroneous second echo".
The file move happened successfully but this inquiry is just to check that no extraneous files were created in strange places. "Move" implies that one file will be moved to one place so it seems there will not be an extraneous file created.
command-line escape-characters
I typed an mv
command and intended to hit the Enter
key. Perhaps I hit the backslash key at almost the same time. If the Enter
key was first, the new line with the green prompt should appear to the left of (before) the backslash. Instead the backslash is to the left of the green prompt.
There is second backslash and perhaps it starts an escape sequence. Why did the color of the prompt change to white when my usual prompt color is green? I am not sure if I typed the second backslash or if it is somehow an "erroneous second echo".
The file move happened successfully but this inquiry is just to check that no extraneous files were created in strange places. "Move" implies that one file will be moved to one place so it seems there will not be an extraneous file created.
command-line escape-characters
asked Nov 19 '17 at 4:08
H2ONaCl
1346
1346
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
Instead the backslash is to the left of the green prompt.
Because the backslash you typed printed before the prompt was output. And then the prompt was output, and the backslash you typed was added to it.
Why did the color of the prompt change to white when my usual prompt color is green?
Because your $PS1
is green, but your $PS2
, which is what is shown when waiting for line completion, is not. Once the line has been completed (because a backslash at the end of a line continues the line), the prompt will go back to $PS1
.
add a comment |Â
up vote
0
down vote
My testing shows that if I hit both Enter
and backslash keys at almost the same time, this can be reproduced. Assuming the keyboard is well "debounced" (link to info about debouncing) then there was only a single backslash typed so in fact there is a "spurious second echo".
The (single) backslash key can be "deleted" via backspace but only one of the two echos will disappear. The echo to the right of the green prompt will disappear when backspace is keyed. The echo to the left of the green prompt cannot be removed. Apparently I did not "delete" it and proceeded to use the Enter
key again. The backslash Enter
pair is a line continuation sequence which works inside scripts but apparently also interactively. As mentioned by @IgnacioVazquez-Abrams the prompt becomes the one assigned to continued lines and in my case it happens to have a different appearance that is not the same as my usual green prompt.
In my testing, if backspace is used to "delete" the backslash (even though only one of the two echos will be removed) there is no line continuation. This is demonstrated by using the backspace to "delete" the backslash and then hitting the Enter
key. In my test the prompt remained green which means that there was no line continuation sequence formed.
The mv
command was not affected by the backslash because the Enter
key was pressed slightly before the backslash. Proof of this is that the backslash appears on a new line (albeit before the green prompt) which means Enter
, which echos as a newline, apparently was pressed first. Since the mv
command was not affected by the backslash there will be no unexpected files created.
I believe I have seen similar behaviour when using ssh
and I am typing fast. The remote host cannot prompt for the password soon enough so part of my password gets echoed to the left of the password prompt and may be echoed to the right of it also. I don't remember whether the password is obfuscated in both places or only on the right of the prompt.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Instead the backslash is to the left of the green prompt.
Because the backslash you typed printed before the prompt was output. And then the prompt was output, and the backslash you typed was added to it.
Why did the color of the prompt change to white when my usual prompt color is green?
Because your $PS1
is green, but your $PS2
, which is what is shown when waiting for line completion, is not. Once the line has been completed (because a backslash at the end of a line continues the line), the prompt will go back to $PS1
.
add a comment |Â
up vote
1
down vote
Instead the backslash is to the left of the green prompt.
Because the backslash you typed printed before the prompt was output. And then the prompt was output, and the backslash you typed was added to it.
Why did the color of the prompt change to white when my usual prompt color is green?
Because your $PS1
is green, but your $PS2
, which is what is shown when waiting for line completion, is not. Once the line has been completed (because a backslash at the end of a line continues the line), the prompt will go back to $PS1
.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Instead the backslash is to the left of the green prompt.
Because the backslash you typed printed before the prompt was output. And then the prompt was output, and the backslash you typed was added to it.
Why did the color of the prompt change to white when my usual prompt color is green?
Because your $PS1
is green, but your $PS2
, which is what is shown when waiting for line completion, is not. Once the line has been completed (because a backslash at the end of a line continues the line), the prompt will go back to $PS1
.
Instead the backslash is to the left of the green prompt.
Because the backslash you typed printed before the prompt was output. And then the prompt was output, and the backslash you typed was added to it.
Why did the color of the prompt change to white when my usual prompt color is green?
Because your $PS1
is green, but your $PS2
, which is what is shown when waiting for line completion, is not. Once the line has been completed (because a backslash at the end of a line continues the line), the prompt will go back to $PS1
.
answered Nov 19 '17 at 4:27
Ignacio Vazquez-Abrams
32.1k66780
32.1k66780
add a comment |Â
add a comment |Â
up vote
0
down vote
My testing shows that if I hit both Enter
and backslash keys at almost the same time, this can be reproduced. Assuming the keyboard is well "debounced" (link to info about debouncing) then there was only a single backslash typed so in fact there is a "spurious second echo".
The (single) backslash key can be "deleted" via backspace but only one of the two echos will disappear. The echo to the right of the green prompt will disappear when backspace is keyed. The echo to the left of the green prompt cannot be removed. Apparently I did not "delete" it and proceeded to use the Enter
key again. The backslash Enter
pair is a line continuation sequence which works inside scripts but apparently also interactively. As mentioned by @IgnacioVazquez-Abrams the prompt becomes the one assigned to continued lines and in my case it happens to have a different appearance that is not the same as my usual green prompt.
In my testing, if backspace is used to "delete" the backslash (even though only one of the two echos will be removed) there is no line continuation. This is demonstrated by using the backspace to "delete" the backslash and then hitting the Enter
key. In my test the prompt remained green which means that there was no line continuation sequence formed.
The mv
command was not affected by the backslash because the Enter
key was pressed slightly before the backslash. Proof of this is that the backslash appears on a new line (albeit before the green prompt) which means Enter
, which echos as a newline, apparently was pressed first. Since the mv
command was not affected by the backslash there will be no unexpected files created.
I believe I have seen similar behaviour when using ssh
and I am typing fast. The remote host cannot prompt for the password soon enough so part of my password gets echoed to the left of the password prompt and may be echoed to the right of it also. I don't remember whether the password is obfuscated in both places or only on the right of the prompt.
add a comment |Â
up vote
0
down vote
My testing shows that if I hit both Enter
and backslash keys at almost the same time, this can be reproduced. Assuming the keyboard is well "debounced" (link to info about debouncing) then there was only a single backslash typed so in fact there is a "spurious second echo".
The (single) backslash key can be "deleted" via backspace but only one of the two echos will disappear. The echo to the right of the green prompt will disappear when backspace is keyed. The echo to the left of the green prompt cannot be removed. Apparently I did not "delete" it and proceeded to use the Enter
key again. The backslash Enter
pair is a line continuation sequence which works inside scripts but apparently also interactively. As mentioned by @IgnacioVazquez-Abrams the prompt becomes the one assigned to continued lines and in my case it happens to have a different appearance that is not the same as my usual green prompt.
In my testing, if backspace is used to "delete" the backslash (even though only one of the two echos will be removed) there is no line continuation. This is demonstrated by using the backspace to "delete" the backslash and then hitting the Enter
key. In my test the prompt remained green which means that there was no line continuation sequence formed.
The mv
command was not affected by the backslash because the Enter
key was pressed slightly before the backslash. Proof of this is that the backslash appears on a new line (albeit before the green prompt) which means Enter
, which echos as a newline, apparently was pressed first. Since the mv
command was not affected by the backslash there will be no unexpected files created.
I believe I have seen similar behaviour when using ssh
and I am typing fast. The remote host cannot prompt for the password soon enough so part of my password gets echoed to the left of the password prompt and may be echoed to the right of it also. I don't remember whether the password is obfuscated in both places or only on the right of the prompt.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
My testing shows that if I hit both Enter
and backslash keys at almost the same time, this can be reproduced. Assuming the keyboard is well "debounced" (link to info about debouncing) then there was only a single backslash typed so in fact there is a "spurious second echo".
The (single) backslash key can be "deleted" via backspace but only one of the two echos will disappear. The echo to the right of the green prompt will disappear when backspace is keyed. The echo to the left of the green prompt cannot be removed. Apparently I did not "delete" it and proceeded to use the Enter
key again. The backslash Enter
pair is a line continuation sequence which works inside scripts but apparently also interactively. As mentioned by @IgnacioVazquez-Abrams the prompt becomes the one assigned to continued lines and in my case it happens to have a different appearance that is not the same as my usual green prompt.
In my testing, if backspace is used to "delete" the backslash (even though only one of the two echos will be removed) there is no line continuation. This is demonstrated by using the backspace to "delete" the backslash and then hitting the Enter
key. In my test the prompt remained green which means that there was no line continuation sequence formed.
The mv
command was not affected by the backslash because the Enter
key was pressed slightly before the backslash. Proof of this is that the backslash appears on a new line (albeit before the green prompt) which means Enter
, which echos as a newline, apparently was pressed first. Since the mv
command was not affected by the backslash there will be no unexpected files created.
I believe I have seen similar behaviour when using ssh
and I am typing fast. The remote host cannot prompt for the password soon enough so part of my password gets echoed to the left of the password prompt and may be echoed to the right of it also. I don't remember whether the password is obfuscated in both places or only on the right of the prompt.
My testing shows that if I hit both Enter
and backslash keys at almost the same time, this can be reproduced. Assuming the keyboard is well "debounced" (link to info about debouncing) then there was only a single backslash typed so in fact there is a "spurious second echo".
The (single) backslash key can be "deleted" via backspace but only one of the two echos will disappear. The echo to the right of the green prompt will disappear when backspace is keyed. The echo to the left of the green prompt cannot be removed. Apparently I did not "delete" it and proceeded to use the Enter
key again. The backslash Enter
pair is a line continuation sequence which works inside scripts but apparently also interactively. As mentioned by @IgnacioVazquez-Abrams the prompt becomes the one assigned to continued lines and in my case it happens to have a different appearance that is not the same as my usual green prompt.
In my testing, if backspace is used to "delete" the backslash (even though only one of the two echos will be removed) there is no line continuation. This is demonstrated by using the backspace to "delete" the backslash and then hitting the Enter
key. In my test the prompt remained green which means that there was no line continuation sequence formed.
The mv
command was not affected by the backslash because the Enter
key was pressed slightly before the backslash. Proof of this is that the backslash appears on a new line (albeit before the green prompt) which means Enter
, which echos as a newline, apparently was pressed first. Since the mv
command was not affected by the backslash there will be no unexpected files created.
I believe I have seen similar behaviour when using ssh
and I am typing fast. The remote host cannot prompt for the password soon enough so part of my password gets echoed to the left of the password prompt and may be echoed to the right of it also. I don't remember whether the password is obfuscated in both places or only on the right of the prompt.
edited Nov 19 '17 at 5:16
answered Nov 19 '17 at 4:54
H2ONaCl
1346
1346
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405539%2finterpreting-near-simultaneous-enter-and-backslash-keys%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password