console

How to make programs like nano/pico in linux

I was wondering how to make a program that can output to every line of the console and not just output a line to be tacked on to the bottom. How can I get control of the whole console like that so I could write console based apps? ...

Rails Rake task errors out while console equivalent does not

I have a piece of code that works fine in the console, but in a cron-driven rake task, it errors out every time, saying that the accessor function for one of the has_many relationships is not a valid method. Example: provider has_many instances, so I'm calling provider.instances, and the rake task will throw back an error: "undefined m...

OpenFileDialogs on C# MTAThread application.

Ok, I know that OpenFileDialogs needs STAThread, but i want to start the form from a console application, so I create a Thread for the Form that way I can print things to the console while working with the form, the problem is that if I want to use OpenFileDialogs then I can not print to the console! ...

How to get/set the console cursor position in Ruby (Windows)

I'm trying to write a shell in Ruby, and to implement tab completion I am using the WinAPI function getch to read in a character at a time from the user, checking for tabs. The problem with this is the backspace key: It moves the cursor further back than the prompt (eg, with prompt hello> , the user can backspace the cursor on to the...

suppresing output to console with ruby

Hello, I am writing some unit tests in ruby and have tests like the following: def executing_a_signal a_method(a_signal.new, a_model, a_helper); assert_equal(new_state, a_model.state) end The tests work fine, but the method which runs just before the assertion to execute the logic prints various messages to the console (m...

Python - importing package classes into console global namespace

Hello all, I'm having a spot of trouble getting my python classes to work within the python console. I want to automatically import all of my classes into the global namespace so I can use them without any prefix.module.names. Here's what I've got so far... projectname/ |-__init__.py | |-main_stuff/ |-__init__.py |-main1.py |-ma...

How can I erase the current line printed on console in C ? I am working on a linux system

How can I erase the current line printed on console in C ? I am working on a linux system example - printf("hello"); printf("bye"); I want to print bye on the same line in place of hello. output bye ...

Why does selecting text in a Command Prompt hang the running application?

We have an application that outputs logging info to stdout. However, if it is run in a command prompt window, you can use Mark to select text from the console. If you leave the text selected, the application just hangs and doesn't proceed, until you deselect the text (for example by pressing Enter to copy the selection into the clipboard...

Problem with kbhit()[and getch()] for Linux.

while(ch != 'q') { printf("looping\n"); sleep(1); if(kbhit()) { ch = readch(); printf("you hit %c\n",ch); } } This code gives me a blocking getch() like functionality. I am trying to use this code to capture up down arrow keys. Added: Trying to capture key codes of up arrow gives me 3 chars 27, 91 and 65. Using i...

Using getchar() after read()

Hi I am using raw.c for keyboard capture. Following code finds when an arrow key/ esc is pressed. At the same time I want to read whole words that user inputs and these should be shown on stdout as well. char pp = 0; char p = 0; while( (i = read(0, &c, 1)) == 1) { if (pp == 033 && p == 0133 && (c &= 255) == 0102) /* DOWN */ break; if (c...

Console and Debugger not working while Unit Testing iPhone in XCode

Hello folks, I am building a logic test suite using Xcode 3.1.4. I am able so far to build the test target and see the results inside de *.m test files as compiler errors (if they fail). The problem is that I can't see any information in the Debugger Console and I can't debug since the debugger does not work either. 1.How can I do to...

How do I input data using the eclipse console? (c++)

I'm trying my hand at c++ and am using fedora eclipse (3.4.2) as my IDE. At the moment I'm trying to enter a string of numbers into the console, get the program to sort them and spit them back out. The program is straight out of a book and works with xcode and through a normal terminal - so I know it's correct. Basically I run the prog...

How to get an output console in an Ogre project under MacOSX?

Hello, I'm working on a project using Ogre3D. We recently ported our project to MacOSX but there are some things that were linked to the Windows API. In particular I don't know how this should be translated: #if defined( __WIN32__ ) || defined( _WIN32 ) AllocConsole(); #endif It would be nice to port the project under Linux someda...

How do I lock the console across threads in C#.NET?

Hello :) I have a logger class that handles various information display with pretty colors (yay.). However, since it writes to the console in separated steps (i.e. set color to red, write text, set color to gray, write text, for something that would render "[Error] Description..." with the error being in red), but I have a multithreaded...

Is it possible to build a Console app that does not display a console Window when double-clicked?

Related: Should I include a command line mode in my applications? How to grab parent process standard output? Can a console application detect if it has been run from Explorer? I want to build a console app, that is normally run from the command line. But, when it is double clicked from within Explorer (as opposed to being r...

code blocks 8.02 console program not outputting cout statements with SDL

im currently using the SDL-devel-1.2.13-mingw32 library in code blocks 8.02. with the mingw 5.1.6 installed separately on C:\ this program compiles and runs with no errors but i can't see the last system("pause"); on the screen. When i press any key, it of course skips over the system("pause"); then code blocks tells me that it successfu...

Setting position of a Console Window opened in a WinForms App

Hi, I found some source code in this thread posted by Rex Logan here on SO : link text ... there's also some very interesting code posted in this same thread by Foredecker, but it is incomplete and complex : I'm not up enough on the 'Trace facility to know how to fully implement it ... I am able to use this Console code Rex (kindly) ...

Java - Is it possible to print text that can be edited by the user (for console programs)

Say I allow the user to edit something, like the phone number in an Address Book (actually, that's exactly what I'm doing). Is there something that I can add to println that will allow me to insert a variable to display as fully editable text? The assignment that I'm doing this for doesn't actually call for this, but I think it would be ...

Can I view the result of a callback function using console.log() in Firebug?

Using the example below, is it possible to send the result of the callback function to the console, i.e. the value being returned? rows.sort(function(a, b) { if(a.sortKey < b.sortKey) return -sortDirection; if(a.sortKey > b.sortKey) return sortDirection; return 0; }); What would I use as the argument: console.log(?) ...

Reading output from console program

I need to read output from native C++ console application in my C++/.NET. There are many articles about this, but most wait until the process ends to read the output, which I don't want to, I need to read it immediately after it is "cout-ed" by the process (and don't want to block the GUI while doing so, but that's something I can do on ...