Terminate Keyboard Shortcut for Mulesoft Anypoint Studio - eclipse

It gets really annoying to have to open the console everytime I want to stop debugging. The preferences map Ctrl+F2 to terminate, but this shortcut doesn't seem to do anything. I've tried remapping it but no luck, any ideas?
UPDATE - Must be an issue with Eclipse. I found this similar question which doesn't mention a solution. You would think there would be some way to bind a shortcut to the terminate command given how often it's used.
Eclipse Terminate Keyboard Shortcut

If your purpose is only: how to stop the project (debugging) without opening the Console, then you can right click on the Canvas and select: stop project [project name]

Related

Eclipse Displays Popup on Rename/Refactor Command

I am getting a popup to choose a command to run when pressing the rename/refactor shortcut. I highlight a file in the Package Explorer, press the command, and popup!?!?!
I have used Eclipse for 13 years, and I have never seen anything like this issue. The rename/refactor shortcut has worked flawlessly on every other instance of Eclipse I have ever used.
The closest help which Google could find is to open the shortcut preferences. I unbinded every command associated to the shortcut binding. Still, the popup continues to appear.
If any of this helps, I am on MacOS Monterey 12.5 and using Eclipse 4.22.0.
Shortcut Command Choice Popup

How to manually restart an extension in VSCode?

I just allowed an update to the PowerShell extension, and I'm now presented with this notice:
PackageManagement updated. If you already had PackageManagement loaded in your session, please restart the PowerShell extension.
I would love to know how to do this. I imagine a full VSCode restart would do the trick, but curiosity has got the better of me here. Someday I might need to do this without interrupting other work in progress.
Apparently it can be accomplished programmatically, but before we go there it'd be nice to know how to do it manually.
On the Manage menu for the extension, we have the Disable and Uninstall items:
...but no Restart.
Can this be done?
Not sure how to do that programmatically, but you can restart the PowerShell session by opening the "PowerShell Session Menu" and then click "Restart Current Session". See below:
I was wondering the same thing for the powershell extension, and by poking around I found a potential solution (more of a workaround honestly):
Hit the "Kill terminal" button (trashbin icon)
KillTerminal (requires killing all active terminals)
The following dialogue appears, click "Yes" to restart it:
RestartDialogue
I confirmed too that the version did update: UpdateConfirmed
Press Ctrl + Shift + P to Open Command Palette and Type Restart Extension Host

VS Code Terminal Not Allowing Typing

My VS code terminal was working fine, until one day when I tried to work on a project, that was still open in VS code, my terminal didn't allow me to type any commands. I couldn't type anything. This is the screen that I get.
Okay, for those of you struggling with the same problem, I've managed to solve it by clicking on the drop-down menu that says powershell and changing it to cmd.
this happened to me and simply
close vs code
right click on it
run as administrator
open the terminal and it will work
this problem happened when I changed the default path of CMD
For me, I tried using Powershell/CMD/Bash and I was having errors/blank terminal. I found typing echo hello and pressing CTRL + C made it appear. So in fact, everything was working, my terminal was just blank/glitched out, but was really accepting input.
I had a similar issue when running ionic serve command which runs the development server on the localhost. I paid attention after executing the command above, and it said:
Use Ctrl+C to quit this process
Pressing Ctrl+C then displays:
Terminate batch job (Y/N)?
Type Y or y
then the command prompt is shown again!
Here is a sample terminal window - trimmed for brevity:
For who has this problem using React. This happens when you start a live version using npm start. The terminal that handles the live version of the app cannot be used for anything else.
So to continue using the terminal you need to open a new terminal to use in parallel. To do so just click on the plus icon in the top right corner of the terminal panel then choose the "Power Shell" option. This will open a new terminal without restarting visual studio.
In Mac, when working with Python, this helped me: instead of clicking on the "Run Code" option, click on "Run Python file", in the right corner.
For Ubuntu users this is solved by this solution:
File -> Preferences -> Setting -> Features -> Terminal -> Inherit Env
I found two vscode on my desktop, I opened the other one and it worked. Looks like I updated it but the older one didn't disappear.
If typing Ctrl+C can help to get out of this frozen state, that will be easier to do with VSCode 1.64 (Jan. 2022)
The terminal can type the answer for you.
Terminal -- Auto-reply
The terminal is now able to automatically reply when a specific sequences of characters is received.
A good example of where this is useful, which is also the only default case, is the Windows batch script message Terminate batch job (Y/N)? after hitting Ctrl+C when running a batch script.
This typically just ends up causing problems for the user.
The terminal will now automatically reply with Y and enter (\r) which makes Ctrl+C in Windows feel much better.
Pressing Ctrl+C will immediately reply to the question and return to the prompt:
Theme: Sapphire
The feature was made generically so you can setup custom replies for other thing, just be careful when doing this as you are sending text to the process automatically.
For example you could use it to automatically update Oh My Zsh when prompted:
"terminal.integrated.autoReplies": {
"[Oh My Zsh] Would you like to check for updates? [Y/n]": "Y\r"
}
If you use Clink and enable their similar feature, you can disable it in Clink or in VS Code by setting the reply to null to avoid the two features conflicting with each other:
"terminal.integrated.autoReplies": {
"Terminate batch job (Y/N)": null
}
Go to terminal, preferences, settings.
Check "run code in terminal"
Restart VS.
I changed from bash to powershell in terminal first but the command prompt still not shown.
Then I navigate to File -> Perferences -> Settings and it starts working (command prompt shown)
This seems to just be a display problem. It happened to me when I changed my display settings for desktop icon and app scaling settings.
I managed to fix the problem by simply restarting my computer and re-opening VS code
I had the same problem ... In my case just run vs-code as administrator and works

Stopping a running application in Eclipse from the keyboard?

I can run an application with ⌘F11 or ⇧⌘F11, but how do I stop it from the keyboard?
See the answer from Austin in this question: What is the short cut in eclipse to terminate debugging/running?
The accepted answer in that question only works if you're debugging.
UPDATE:
I checked on this, and at first I couldn't get it to work. It turns out that if you want the terminate command to be available in the Java Editor perspective, you have to go to Window ->
Customize Perspective -> Commands and add the Debug command group to the perspective.
Then, go to Window -> Preferences -> Keys, find the Terminate binding, and change "When" to "In Windows".
That worked for me - I was able to start the app with F11 and terminate with CTRL-F2.
The Terminate command is mapped to ⌘F2 in my workspace.

Whats the shortcut to Debug in PyDev using Eclipse

The shortcut key is F11 to start debugging. But issue is that I have to be on that file and then hit F11 to start debugging.
Eg.
my file to launch the application is "launch.py" and "example.py".
example.py is open in the editor whereas launch.py is not.
Now, if I hit F11 it will try to launch the application using "example.py" and terminates due to error (as expected).
So then I have to open the "launch.py" in the editor and then hit F11 to start debugging the application.
Is there any neater way to configure the debugging, so that it starts the application in single hit/key?
Edit: example.py is some other file (some module). It does not launch the application.
As this PyDev Eclipse Tutorial suggests:
After the first run, if you type Ctrl+F11, the last file ran is re-run. Or, if you type just F11, a debug session is started with your last run. Let's test this...
Note: This behavior changed in Eclipse 3.3 -- but it's generally recommended to restore it in the preferences at: window > preferences > Run/Debug > Launching and set the Launch Operation to Always launch the previously launched application.
This tutorial will always consider this as the default option.
So, did you have this option selected?
If you have launch at least once launch.py, then you can re-launch it easily.
Although this isn't strictly an answer to what was asked initially, it might help someone looking here that had the same problem as me...
I'm a Java developer mainly, so have the Java view open almost all the time. However, sometimes I want to run some python file to test something (or just create a quick python script, and run it)...
In the Java editor, if the current class has a main(String[] args) method, I run it with (and popup the dialog to ask me what exactly I'd like to run in the middle)
alt+shift+x, j
Unfortunately, that doesn't work in the Python view, and I've not found a similar solution - it just asks me if I'd like to run it as a Java app... however, as the VonC says, you can run the last run thing (provided you've set the preferences accordingly) with
ctrl+f11
and this seems work well with python run configurations too.
But... What if the last thing I ran was a Java program, but I now want to run the active .py file? Previously, to run the .py file, I'd have to go digging through the buttons on the toolbar with the mouse, and I tend to prefer keyboard shortcuts...
Solution! So, finally I come to the actual useful bit of this answer - I just discovered by accident (typing Ivan's suggested shortcut, but missing!), it appears that
f9
will run the currently active python file.
Hope that helps someone get just that little bit faster...
I use CTRL+SHIFT+F9 to relaunch the previous debug configuration in Pydev.