Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 🐛 Stata inserts ESC as a character into input

    I've been looking for a way to reproduce this since about the times of Stata 10, and finally today found a reliable scenario:
    1. make sure the output window is full of content so that the vertical scroll bar appears;
    2. in the command line start typing a command, make sure there is a word followed by a space
    3. left click the output window
    4. scroll the output window with a mouse wheel
    5. press ESC
    Expected: the command window becomes active and the keyboard cursor is restored at the end of the line (or last active position)
    Actual: the ESC character is pasted into the input line. In older Statas it was shown as ^Z, in Unicode Statas it is shown as ESC:

    Click image for larger version

Name:	special_chars.png
Views:	1
Size:	1.6 KB
ID:	1488195


    Occasionally other characters may appear, but ESC is the most frequent one.

    Click image for larger version

Name:	special_chars2.png
Views:	1
Size:	1.8 KB
ID:	1488196


    The above scenario occurs pretty frequently when you start typing the command and realize you need to find e.g. the exact variable name from the output content which is already off the screen. In this case the behavior of the keyboard is rather irksome.

    Observed in Stata 15.1MP for Windows. and in earlier versions dating back a few generations.

  • #2
    I have had this or a related problem for several years, but have been unable to find a reproducible example. However, Sergiy's report leads me to ask what you get if you do the following:

    Code:
    sysuse auto
    list
    This fills my output window

    Now place/click the cursor on the output window. A couple of versions ago (pre Unicode functionality), you used to be able to, at this point, hit the ESC key and it would return control/cursor to the command window -- a nice feature, I always thought. However, nowadays, I get the ESC character showing in the command window, just as Sergiy reports.

    I'm using up-to-date Stata 15.1/MP4 on Windows 7/64 pc. Same behaviour with up-to-date Stata 14.2 on same machine. Do others get the same?

    Click image for larger version

Name:	2019-03-15_1452.png
Views:	1
Size:	166.6 KB
ID:	1488310


    Comment


    • #3
      The behavior is a bit erratic. The ESC character appears in my command window after left-clicking in the output window and then pressing the ESC button if at least one character was entered in the command window. That does not have to be a word followed by a space as in Sergiy's example. A simple space or letter is already sufficient. It is also not needed to have a full output window (works already right after opening Stata). Yet, when I then remove the ESC character from the command window and try to redo the same steps, the ESC character does not appear again unless I switch back and forth between Stata and a different program in between (and this also only works sometimes but not always).

      Edit: It seems that you can just start typing something in the command window even if the output window is active without using the ESC button.
      https://www.kripfganz.de/stata/

      Comment


      • #4
        On my MacBook Air running
        Code:
        . about
        
        Stata/SE 15.1 for Mac (64-bit Intel)
        Revision 20 Feb 2019
        the following
        • sysuse auto, clear
        • list
        • in the Command window type "describe " (without surrounding quotes, with trailing space)
        • click the Results window (one-finger tap trackpad)
        • scroll the Results window using the tab in the scroll bar or using a two-fingered swipe on the trackpad
        • press ESC
        results in the cursor returning to the Command window, no additional material displayed, and hitting return produces the describe output.

        If I do not click the Results window, I can move the cursor over it and scroll as before, but the input focus remains on the Command window and pressing ESC results in the typed command being erased.

        Comment


        • #5
          William Lisowski describes that on the Mac this sequence is working as I expected it, perhaps the Windows version can be aligned to the same behavior.
          Thank you, William and colleagues for taking time to look into this!

          Comment


          • #6
            Just to say that the issue I reported in #2 also arises in Windows 10. If (on Windows 10) I do the sequence of actions that William in #4 reports, my first hit on the ESC key places an "ESC" symbol after the -describe- in the Command window. If I hit the ESC key again, the typed command is erased.

            I echo Sergiy's request that Windows behaviour be aligned with that of Mac. (William's reported Mac behaviour is what I recall from pre-Unicode versions of Stata for Windows -- which I no longer have.)

            Comment


            • #7
              PS I discover I still have Stata 12.1 and Stata 13.1 (for Windows). If I repeat the #2 sequence using each of these, I do not get the problem I reported. Repeating William's sequence (#4) I get the same as he described. Which is what I would like to have ...

              Comment

              Working...
              X