Description
-
Tested in ksh93 and ksh88
-
On prompt type
(A) -
Your cursor is now to the right of )
-
Type
-
Your cursor is now over the A
-
Type , the result should now look like
(A)
the cursor is over the right paren.
- Type
- This appears on the screen
(A^B)
this does not appear correct to have ^B shown
- Goto step 2, try for step 8, same behavior
There is a video reproducing this at:
https://www.youtube.com/watch?v=ojfAgdnwQzw&feature=youtu.be
Notes from KSH mailing list discussion:
Kurtis: That behavior is present in the ksh93u+ release and thus is not something introduced since the most recent stable release seven years ago. Note that the unexpected behavior is due to the backslash. Without the char under the cursor being a backslash [ctrl-B] and [ctrl-F] behave as you would expect. This affects pretty much every control char such as [ctrl-A] to move to the start of the line. Whether this behavior is good or bad is debatable. If you feel it should be changed, despite being long standing behavior, please open an issue
The problem isn't the presence of parenthesis; it's the backslash. Type a\[ctrl-B]
. This behavior only happens if the most recent character you typed is a backslash. So you can type a()b
, then move the cursor inside the parens, type \[ctrl-B]
and the same thing will happen. Personally, I think the magic backslash is a misfeature. You can always type [ctrl-V][ctrl-B] to insert a literal [ctrl-B]. Feel free to open an issue. Even better, create a patch for us to review.
On that platform /bin/ksh is 93t+ 2010-03-05 and exhibits the behavior you described. You should be able to run /bin/ksh --version
to figure out which ksh variant you're using.
Having said all that I agree with you the behavior is confusing and should be changed regardless of how many years it has been in effect.