console

How do I use Console.CancelKeyPress in .NET 4? (Works fine in .NET 3.5 and below)

I am writing a Console app in C# 4 and want to gracefully cancel my program and Ctrl + C is pressed. The following code I have used many times before, but now when trying to use it in .NET 4, it seems a strange unhandled exception is occurring. namespace ConsoleTest { class Program { private static bool stop = false; ...

Launching external console application from Java

Hi in a Java application I need to run an external console application. With the window's ones everything is OK: try { System.out.println("Running..."); Runtime.getRuntime().exec("notepad.exe"); System.out.println("End."); } catch(Exception e) { System.out.println(e.getMessage()); } launches notepad successfully. But if...

Python - react to custom keyboard interrupt

Hello. I am writing python chatbot that displays output through console. Every half second it asks server for updates, and responds to message. In the console I can see chat log. This is sufficient in most cases, however, sometimes I want to interrupt normal workflow and write custom chat answer myself. I would love to be able to press ...

Create a console from within a non-console .NET application.

How can I open a console window from within a non-console .NET application (so I have a place for System.Console.Out and friends when debugging)? In C++ this can be done using various Win32 APIs: /* EnsureConsoleExists() will create a console window and attach stdout (and friends) to it. Can be useful when debugging. */ FI...

Redirect console input and output to a textbox.

Hi there and thanking in advance I am trying (very hard) to redirect Console input and output into a textbox. So far output is working fine but the trouble is with input. For example I cannot execute a simple program that will do the following: Console.WriteLine("Please enter your name: "); string name = Console.ReadLine(); Console.Wri...

How to receive an argument in console program?

So I want other users to be able to run my programm sending arguments. how to do such thing? ...

Split command across lines

In Linux shell, one can split a command across several lines using \. For example: cmd \ arg1 \ arg2 How can I do the same using Windows console? Thanks! ...

cscript - print output on same line on console?

If I have a cscript that outputs lines tothe screen, how do I avoid the "line feed" after each print? Example: for a = 1 to 10 WScript.Print "." REM (do something) next The expected output should be: .......... Not: . . . . . . . . . . In the past I've used to print the "up arrow character" ASCII code. Can this be done i...

An Interactive Console I/O Wrapper/Interceptor in C# - What is the issue?

I was trying to put together an interactive Console interceptor/wrapper in C# over the weekend, by re-mixing few code samples I've found in SO and other sites. With what I've as of now, I'm unable to read back from the console reliably. Any quick pointers? public class ConsoleInterceptor { Process _interProc; public event Act...

Console Application GUIs

How are GUIs like this made, but in console applications? There are many examples, such as alsamixer: ...

ObjectDisposedException when outputting to console

If I have the following code, I have no runtime or compilation problems: if (ConsoleAppBase.NORMAL_EXIT_CODE == code) { StdOut.WriteLine(msg); } else { StdErr.WriteLine(msg); } However, in trying to make this more concise, I switched to the following code: (ConsoleAppBase.NORMAL_EXIT_CODE == code ? StdOut : StdErr ).W...

How to tell if running in a linux console versus an ssh session?

I have an application that needs to behave differently if run directly from the linux console. So if a user connects with SSH to run FooBar, or the user walks over to the console and logs in directly to run FooBar, I want it to do something different. What C API do I need to call to tell the difference between these two scenarios? I w...

Rails-like console for PHP?

Every so often, things work in my local PHP development environment, while in my test environment on my server, things do not. It's a nightmare to debug this. If I had a console like Rails provides, debugging would be much much simpler. Is there anything like the Rails console but for PHP? I should mention that I am using a home-brewn ...

Would dropping X altogether hurt ?

Hi, I live in the linux terminal all the time under my slackware GNU/linux system (an EeePC). By default, GNU Emacs won't start if It can't find several Xorg libraries. Assuming I will never use X software at all, would it make sense for me to drop all this Xorg stuff and compile emacs again ? Are you aware of anything that could get m...

Problem with Interface Builder and Xcode

Hi, From some reason, any time I connect IBOutlets or IBActions in Interface Builder, and build my app, the app crashes. In the Console Log I get this: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key leftWebView.' How can ...

Portable way to hide console window in GLUT application?

Hey, I'm creating a little GLUT application and need help with hiding/removing the console window. I am developing on windows and I already know of the various methods to hide the console window on a windows system, however is there no portable method of hiding it? Thanks... ...

Error while attempting to output data onto console in xcode

I am trying to output general data (source code) from a website, but it just sits there. Can't figure out if its the interface or the code. Would someone double-check for me? #import "Lockerz_RedemptionViewController.h" @implementation Lockerz_RedemptionViewController -(IBAction)start: (id) sender { while (1) { NSMutableData *m...

getting number from console!

Hi this is my method that will be called if I want to get a number from user. but if the user also enter a right number just the "else" part will be run ,why? please help me tahnsk. public static int chooseTheTypeOfSorting() { System.out.println("Enter 0 for merge sorting OR enter 1 for bubble sorting"); int numberFromConsol...

How to extract and translate CakePHP core strings?

How can I extract strings defined in the CakePHP core (like the auth component messages) with the cake i18n console? I tried to run cake i18n extract with both the path to the app folder and the cake folder but this did not give me the cake core strings in the .pot file. ...

Changing iSeries Device and PC console password.

I am setting up first console session on iSeries. How do reset console password on PC and iSeries without access to a console? Thank you Ashok ...