Command Window not registering keyboard input after input command

When I run an input command, the cursor shifts to the command window waiting for an input, but when I start typing nothing happens. If I then click on the command window and begin typing, it works as normal.
Also when the command window is undocked, it works fine. It is only when I dock the command window that it is not registering text.
For example if I run:
clear; clc;
commandwindow
number = input('Enter a Number: ');
Then the focus shifts to the command window and it prints "Enter a Number: " but I cannot type anything until I click on the command window.
Never had this problem on the old versions of MATLAB, I am running 2022a.
Cheers

9 Comments

Which operating system do you use?
Currently running macos monterey 12.2.1
I have this same issue. macOS Catalina 10.15.6
What if you comment out the "commandwindow" line? I never had the need to use this command in a script using input().
Same issue with or without the commandwindow line, in fact if I run nothing but 'commandwindow' and no input line like this:
clear; clc; commandwindow
I still have the same problem, can't type until I click on the CW. I added that line to see if I could force it to switch focus to the CW but it seems to be the act of switching that is causing the issue.
Same issue here running 2022a on Monterey 12.3.1. It also happens when I use Control+Tab to change focus from the editor to command window. However it does accept arrow keys and shift+F7 on the touchbar, to run from command history for example.
Same here. macOS Monterey, MATLAB 2022a. Very annoying.
I am having similar issues In Matlab R2022b running on MacOS Monteray V12.6.1. I notice the behavior changed when upgraded to R2022b from R2020a previously (I think).
If I simply switch from the editor to the command window with shortcut key "ctrl" + "tab" the cursor keys work in the command window, but no other keys will work. I find myself now having to use excessive mouse clicks to engage the command window to start registering text from the keyboard. Supper annoying and destructive to my workflow, and I think this is seriously going to give me carpal tunnel from all the extra clicks needed.
Hi Michael,
yes, this is really a show stopper. I had the same issue, when switching to the cmd window using cmd+0.
On my Mac (now Big Sur 11.7.1), the keyboard input worked as expected, when I undocked the comand window. Even with the cmd window on a second screen, this is just a temporary solution, though, but may prevent carpal tunnel…
Best of luck!
On a similar note for OS X users: I also switched the JRE version to OpenJDK (Adoptium / Temurin v8) and created a launcher, which opens MATLAB via bash. At least for, this combination prevented a lot of crashes ('disk of death') when working with figures or switching windows and screens. Overall, it seems that MATLAB does not play nice with OS X window system.

Sign in to comment.

Answers (2)

Same issue on macOS Big Sur 11.6.8 running R2022a Update 4: the command window seems to get the focus (visually in the GUI + the arrow keys stay responsive), but it does not react to character inputs or the enter key. Very annoying. Please fix this.
A workaround for me is to undock the command window.

1 Comment

macOS Sequoia15.3 running R2024b: I was battling the same issues even when I undocked the command window. After switching from Amazon Corretto jenv to Adoptium Temurin jenv I was able to swap back and forth easily with CTRL + ~
I did move from OpenJDK Java 11 to 21. Not sure if that was the switch that made the difference.

Sign in to comment.

I have the same issue, updated now to 2023b on my MacBook Pro running now on macOS Sonoma 14.2 but the same issue still exists unfortunately. Lots of extra mouse clicks need. Also switching between matlab windows using command+~ does not work all the time properly.

2 Comments

Still on macOS Ventura, using the 2023b and I also (still) have the issue as described above.
However, I switch windows using the keys macOS (re-)defined keys, which works fine. Also, it helped a lot to use the OpenJDK Java 11 which is finally supported – before we could only use version 8. Some UI setting have to tweaked, but a lot of issues (e.g., crashes) disappeared.
The procedure is described here (MATLAB Central). You may want to give it a try.
thanks, will check out how this may help

Sign in to comment.

Categories

Products

Release

R2022a

Asked:

on 9 Apr 2022

Commented:

on 12 Feb 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!