(Eclipse) How to interact with console view? - eclipse

Eclipse uses console view as read-only.
How can I type command in console view? Is it possible? E.g: ls, mvn install...
Edited:
Thanks Ben and Kelly.
I understand I can interact with Eclipse's console when my application is running. However, I meant I want an embedded console as like as the one in Kate, Dolphin (press F4 in Dolphin)... So I can use bash script in Eclipse's console. Is that possible? Or is there a plugin for that? I have googled but perhaps my keywords were not right...
Edited
Edward has found duplicate question here: Is there an Eclipse plugin to run system shell in the Console?
And it was answered :-)
I don't know how to mark this one as solved. So I place message here, I got the answer.
Edited
But it is not useful. It doesn't have auto complete feature, when I need to type a long file name, or want a hint for a forgotten name,... it is worst :-(

When the console is waiting for input it shows a green prompt that allows you type.
You can test it out by making a simple console application that reads from standard input.

You are trying to think of the Eclipse console as if it were connected to a command-line process. It is actually connected to the JVM used to execute your Java code. Thus, it only shows output that your program sends to System.out and conversely only is available for input if the Java code you are running is requesting input from System.in.
A decent exercise would be to write a small Java program that redirects the input and output to a child process of your favorite shell, for example: http://www.devdaily.com/java/edu/pj/pj010016

The Eclipse Console view is used for communicating with an executed program (typically Java, or similar). If you want to use it as a console, as mentioned in the comment under #Ben S's answer, the Target Management Eclipse project provides a view that can be used for that reason. I don't have it installed right now, so I cannot tell you the required plug-in/view name, but I have used it to connect to the local computer and works.

Related

Running simple Scala in Intellij

I'm trying to run a very simple hello world Scala program in IntelliJ IDEA on Mac without using the Scala console configuration. I have followed these steps to largely get started, but I didn't set up the debugger outlined there. There isn't a default run configuration enabled, but I can right-click on my source file and select "Scala Console," as we can see here:
Is there a way to select or edit my configurations to make it so I don't have to use the console? Below are the available configurations.
I simply want there to be a way to run my Scala code and see the generated output in the provided console, which Scala Console isn't doing. Thanks for your time.
Lab6 should be an object, not a class.
This will allow you to run it as a main method

Creating VSCode Debugger Extension

I'm in the process of trying to write a VSCode extension to support basic SNES application development. I already have a basic grammar definition and build task, so I have syntax highlighting, and am able to build my project with Ctrl+Shift+B using the bass v14 assembler, but now I'm trying to figure out how to launch the project using launch.json. I've already worked through the official docs and played around with the mock debugger project, but I can't seem to figure out how to adapt it for my extension. To start, I'm using the bsnes-plus emulator as my debugger. There isn't really any command-line or IPC interface that will actually allow me to implement a proper debug adapter, so all I really want to do is to run the program and pass it my output file to launch. For the time being, I'm assuming that bsnes-plus.exe is located in my $PATH, but eventually I'll try and figure out the best practices for external executable dependencies for an extension.
So here are my current questions:
Is the "program" field of launch.json my compiled application, or is it bsnes-plus.exe?
If "program" is my application, where do I specify bsnes-plus.exe? Or vice versa.
Is there a way to specify my own project-level variables, e.g. $OUTPUT so that I don't have to hard-code the output filename into both the build task and the launch task?
At one point, I was able to get the launch command to open bsnes-plus, but not load the game, and when I closed it, VSCode complained that the debugger terminated unexpectedly and immediately re-opened bsnes-plus. How do I avoid this? Do I need to write a debug adapter even though it's not going to actually do anything other than launch the application, just so I can tell VSCode that it exited cleanly?
Is the "program" field of launch.json my compiled application, or is it bsnes-plus.exe?
This is entirely up to the debug extension. It's just passed through to the debug adapter. It usually corresponds to the specific app/script being debugged though, not the runtime that's running it, so I would suggest it should be your compiled application.
If "program" is my application, where do I specify bsnes-plus.exe? Or vice versa.
You can put it any other field. In Dart, we have a dartPath field that can be passed through to the debug adapter. It's usually populated silently by the DebugConfigurationProvider.resolveDebugConfig though (we detect the SDK by searching PATH) so the user never needs to add it.
Is there a way to specify my own project-level variables, e.g. $OUTPUT so that I don't have to hard-code the output filename into both the build task and the launch task?
You can't make your own variables, but using resolveDebugConfig you can manipulate the launch config yourself before it's passed to the debug adapter, which probably allows you to do what you need here (eg. you could do a string replace on program - or you could even just add it if it's not set, allowing a launch.json-less launch too).
Do I need to write a debug adapter even though it's not going to actually do anything other than launch the application, just so I can tell VSCode that it exited cleanly?
I'm not sure what happened here without more details, but having a debug adapter probably makes the most sense - for example if you want to make the Stop/Restart buttons work on the toolbar, you'd probably want a debug adapter that can terminate and/or restart the process.

Debugging embedded system with Eclipse - HOW TO PRINT TO A LOGGING FILE?

I'm currently working on a project on STM32F4 and I'm using Eclipse. I've got some problems with the program - it seems to have a random behavior - sometimes it works fine, other times it has some errors. Sometimes when I try do debug with breakpoints I get the beautiful HardFault Handler and it really messes with my brains.
Sorry for the little off-topic paragraph, just wanted to let you know why I decided to use printing to a log file at some key moments in the program so I can see in which states and in which functions does the problem occur. I'm debugging through a JTAG interface with Eclipse (gdb) and I need to know if there is an easy method integrated in Eclipse that may help me use fprintf-like functions inside my program to write to a file on the disk.
If no, any other solutions?
Thanks
I do not like to connect the debug output log to the Jtag communication port because the log will not be available after development.
I usually build an SystemLog library that can send the log messages through any medium that is available (UART, USB, Ethernet or SDCARD). That's what I'd recommend you to do. It will help you through the development, and the support team on the event of any failure on field.
If stdlib is available in your project you should use the snprintf family functions to build your SystemLog.
Also, you can integrate the log output to the eclipse console by calling a serial console communicator (if you use UART) on you makefile, in this case, your makefile will have to flash the target as well.

deploying a scala app built using IDEA

I developed a simple scala app that uses casbah to query the DB for the command line argument passed to it. For example
$ querydb.scala execution 10
it will run a casbah query to find 10 records matching execution in mongo. Now i have two questions.
1) How do i test this in my local. If i click execute in intellij it is just running the program, i am not able to pass command line arguments to my program.
2) How do i deploy it to run on my server, it is just going to used as console app in my ubuntu server, but im not sure how i should deploy this, which files i should put up on the server and how do i execute it in server, and stuff like that.
Any pointers would be useful for me.
or try to use sbt, IDEA has a plugin with sbt, the wiki of it has an explanation on how to use it.
I usually use sbt directly in Terminal instead of running in IDE.
1) First you need to find "Select Run/Debug Configuration" button at the top of your screen
Click on it and choose edit
Create new one, if you haven't got it yet.
Your program parameters should be written in "Program parameters" field
2) Compile your .scala files with scalac and you'll got .class files.
Then deploy it, as you usually do with java code. Hence you don't need to install scala on target machine - all you need is JDK.

What is Zend's console? When do you use this console?

Does any one know what is the use of Zend's console?
any sample program ?
Console = the shell, or command line. If you have Windows go to Run and enter 'cmd', if you have a Mac open Terminal. Console scripts are useful for long processes or things you want to schedule to occur on a regular basis (the 'cron' RaYell refers to).
For example, I wrote a link checker script for checking links for websites we develop. It's used to help QA sites and check for errors. That command looks something like:
php linkchecker.php http://www.domain.com
The third bit is any arguments that are passed to the script. These can easily be accessed via Zend Console Getopt which is the only stable component of Zend_Console I'm aware of.
More info on Zend Console Getopt - http://framework.zend.com/manual/en/zend.console.getopt.html
There are details of Zend Console itself which are on the developer wiki, but I don't know if this is currently being developed - http://framework.zend.com/wiki/display/ZFPROP/Zend_Console+-+Wil+Sinclair
Zend console allows you to write console apps in PHP. It can be very useful if i.e. you want to run certain actions of your app with CRON.