terminal

Sending ctrl + z to console program

I have a simple console program written in C and want to abort a text input with CTRL + Z. How is it possible? Edit: Here is some code (untested). #include <stdio.h> int main() { float var; while(1) { scanf("%lf", &var); // enter a float or press CTRL+Z if( ??? ) // if CTRL+Z was pressed { ...

How to have colors in vim when :syntax on does nothing ?

Hello, Logged as root on a CentOS 5.3, I can't have colors in vim (7.0.237, minimal, common and enhanced rpms), even with :syntax on ... I can display colors with other commands, so I have colors (I don't know how many !) Any clue ? Thanks. ...

Execute SQL script to create tables and rows

I have a database that I created using the CREATE DATABASE statement in the terminal and I have a .sql file full of statements creating tables and rows. I just wanted to know what was the command line to execute that .sql on the database I created? ...

Terminal not running shell bash

Hi, My terminal somehow turned into some kind of a text-editor, I open it up and the window title says "Terminal - Login - 130x33" with no prompt, just a black window with a cursor just like any text editor, my understanding of the problem is that the Terminal.app is not running bash when it starts. I tried deleting the Terminal's pref...

Yanking text from the previous stdout onto the command line.

I'd like to set up my Bash in such a way that I could yank text from the previous command's stdout. The example use case I'll use is resolving conflicts during a git rebase. $ git status # Not currently on any branch. # Unmerged paths: # (use "git reset HEAD <file>..." to unstage) # (use "git add/rm <file>..." as appropriate to mark...

Testng terminal report

I run test cases from maven, that is from command line. Is there a way to see a reason why test failed in terminal output? I've tried raising verbosity in testng.xml to 4,hoping that it will activate TextReporter, which seems like class that prints, well, text reports, but it didn't help. ...

Writing ONLY in the last line of a text box in Java SWT

Hi all, I'm developing a program like Terminal in Linux or Command Prompt in Windows, but I'm developing it on Linux, and I don't care much about portability. The program is written in Java, using SWT. The user writes the commands in a text box, and when he presses 'enter' it reads this line and interpret it. The problem is that the ...

How do I change the display name in terminal (os x 10.6)

I have used this script to install imageMagick: Google: maddox magik-installer - its the first hit My terminal name is a string of cryptic letters and numbers. See image here: http://i302.photobucket.com/albums/nn92/wandoledzep/terminal.jpg Keep in mind my computer name in the "Sharing" system preferences is localhost. Any ideas how...

How do I reset my ~/profile from the Terminal in Mac OS X 10.5?

Greetings, I recently installed tomcat on my OS X 10.5 box and while I was playing around with the ~/profile I accidentally put in a bad alias and saved it. Long story short every time I open up the Terminal app it tries to launch the alias and hangs up and is unresponsive with keyboard commands. I tried deleting my Home folder -> Lib...

Vim colorscheme change

I'm having difficulty getting my colorscheme to change. I've opened both ~/.vimrc and /usr/share/vim/vimrc and added: colorscheme desert ...and nothing. I noticed the color schemes are here: /usr/share/vim/vim72/colors/desert.vim (...along with a bunch or others) which seems like the wrong place so I: cp /usr/share/vim/vim72/color...

How do I programmatically change the position of the cursor in a Mac terminal program?

How do I programmatically change the position of the cursor in a Mac terminal program? I'm teaching a couple of kids to program and we're learning by writing a little terminal game. I've done this with C# on Windows with SetCursorPosition(x, y) so I'm hoping for something like that. ...

diskimages-helper problem when mounting on a mac

Hi guys, Ive got a program that runs on Mac OS 10.5.8. The program runs a continuous cycle where it mounts an image, installs a browser plugin and unmounts the image again. If I leave this program running I eventually end up in a situation where I get the following error "fork: resource temporarily unavailable". In the activity monitor ...

List the details of a network directory with a shell script.

This is new to me a little. But my objective is to run a script that will display the directory of a network drive. I am on a mac and the network drive is a local SMB connection. I have been able to use ls ~/Documents and that lists a specificed local directory, but I am unable to get it to show contents of a network directory. BTW...

OS X Bash Auto-Completion question (spaces in directory names)

Hi all. I'm pretty new to this whole Terminal business and had things working nicely on my old laptop with Snow Leopard installed. New laptop with Snow Leopard works differently, however. When using the terminal, when trying to get auto-completion to work, it won't autocomplete for directory names with spaces in them. I know I can type...

Why do some ssh sessions offer autocomplete and some not?

Very newbie question! I'm sshing to two different servers, both part of the same Amazon AWS cluster. They're not run by me. On one ssh session, the terminal lets me autocomplete. On the other session, it doesn't - I wish it did. Why is this - is it an option set by the server administrator? And can I do anything about it? thanks! ...

How do I move printing position up one line in terminal.

I'm already aware of using \b and \r to move back one character and to the beginning on the line respectively. But is there a way, (specifically in python,) to move the cursor position up 1 line? I'm trying to avoid using curses, but if this is the best option then so be it. ...

Strange newline when attempting unbuffered reading in python

I have this code: def getch(self): if os.name == 'posix': fd = sys.stdin.fileno() old_settings = termios.tcgetattr(fd) try: tty.setraw(fd) ch = sys.stdin.read(1) finally: termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) elif os.name == 'nt': ch = m...

Would it be possible to jump between prev/next Terminal command prompts?

Hi, I'm using zsh in OS X Terminal.app and for quite a while, I've been longing for a way to jump back and forth between prev/next prompts in the terminal's output. One convenience with this would be to be able to review (and track errors at) the end of each command's output; eg. when you building stuff from source with ./configure; mak...

Clearing terminal in Linux with C++ code.

Okay, I have been researching on how to do this, but say I am running a program that has a whole bit of output on the terminal, how would I clear the screen from within my program so that I can keep my program running? I know I can just type clear in terminal and it clears it fine, but like I said, for this program it would be more bene...

Read Facebook private messages from bash terminal?

I'm a long-timed Mutt user. Is there a way to read, delete and reply to Facebook private messages in mutt-like style, from a bash Ubuntu/Debian terminal? Thanks ...