terminal

Linux Terminal Problem with Non-Canonical Terminal I/O app

I have a small app written in C designed to run on Linux. Part of the app accepts user-input from the keyboard, and it uses non-canonical terminal mode so that it can respond to each keystroke. The section of code that accepts input is a simple function which is called repeatedly in a loop: char get_input() { char c = 0; int res =...

Open a new tab in gnome-terminal using command line.

Hi, When I write gnome-terminal --tab at the terminal, I expect it to open a new tab in the same terminal window. But it opens a new window instead. I found out that its intention is to open a new tab in a new window, i.e., if I write gnome-terminal --tab --tab it will open a new window with two tabs. So, the question is...

Expert R users, what's in your .Rprofile?...

This question is maybe a little too cute, but I have always found startup profile files of other people both useful and instructive about the language. Moreover, while I have some customization for bash and vim, I have nothing for R. For example, one thing I always wanted is different colors for input and output text in a window terminal...

syntax error: Expected end of line but found unknown token.

Hi Everyone: I am attempting to run some AppleScript in the terminal, just to learn how to do it, and I am running into some trouble with the & sign. Even when the & is replaced with the "&", it still returns the same error.. I have narrowed it down to the problem with the & sign, and am wondering if anyone has any advice about it. I...

How to start a process from another application and then open a terminal to that process in gnu screen

I'd like to be able to launch a process from a GUI application (right now I'm thinking specifically of letting an eclipse user -- possibly via a plugin -- click a button to launch a build using my organization's build system). I don't want this process to stop when I stop the parent application, and I want to be able to "switch into it"...

Find the current stdout OR How to redirect the output back to console.

I'm using Ubuntu 9.04 x64 and, I have a file startup.rb in which I call sudo bash, so that I always have a root console to do administrative tasks without typing password after every 15 minutes or so. This script is called by another script Startup.rb, and content of both files are like this - File ~/Startup.rb #!/usr/bin/ruby system...

A way to parse terminal output / input ? (.bashrc ?)

Is there a way to parse input and output from bash commands in an interactive terminal before they reach the screen ? I was thinking maybe something in .bashrc, but I'm new to using bash. For example: I type "ls /home/foo/bar/" That gets passed through a script that replaces all instances of 'bar' with 'eggs' "ls /home/foo/eggs/" gets...

Infinite loop when running code in terminal from xcode

Hello everyone I'm writing a small app to keep track of local mono sites. I'm mostly writing this for my own use and to play around with xcode To start the server i run the following code: [task setLaunchPath: @"/usr/bin/xsp2"]; NSArray *arguments = [NSArray arrayWithObjects: @"--root", [[document selectedSite] valueForKey:@"path"], ...

why is screen not showing the current running process name? (Mac OSX Terminal bash)

I am running screen inside Mac OSX Terminal app (bash). Here is the screenrc (got it from here): $ cat ~/.screenrc termcapinfo xterm* ti@:te@ startup_message off defutf8 on shelltitle "$ |what?" # make screen assign window titles automatically hardstatus alwayslastline hardstatus string '%{= kw} [ %{= kb}%H%{= kw} ][%= %{= kw}%?%-Lw?...

How to Open Terminal Window Automatically on Mac OS X

On my Mac, there is no window open when I start Terminal app. I just played with a friend's Mac, a window is automatically opened on startup of terminal. He doesn't know how it's done. I just played with preferences and couldn't find anything for that. Does anyone know how to do that? ...

Run terminal commands from GUI app??

Hey guys, Do you guys know how to run terminal commands from you GUI application? I need the coding for my app. For example, if I type "netstat" in terminal it will give me all the ports. I want to this from my xcode app. Is that possible? BTW it's not just the "netstat" command it could be "sudo.... " Thanks, Kevin ...

Why is Standard Input is not displayed as I type in Mac OS X Terminal application?

I'm confused by some behavior of my Mac OS X Terminal and my Django manage.py shell and pdb. When I start a new terminal, the Standard Input is displayed as I type. However, if there is an error, suddenly Standard Input does not appear on the screen. This error continues until I shut down that terminal window. The Input is still being ...

Terminal Browsing Problem

Why does the code not open the proper Google page? elinks http://google.com/search/?q=`echo "ERROR database is being accessed by other users" | sed 's# #+#g'` ...

Enabling italics in vim syntax highlighting for mac terminal

I'd like to have vim display my comments in italics, and I understand I need to place cterm=italic in the hi Comment line in the color.vim file I'm using. This, however, is having no effect on the text display, which I suspect has to do with some Terminal.app setting, unless I'm misunderstanding the vim syntax. I'd appreciate if some...

Which terminal colors do you use? Which colours generate the least eye strain at the end of the day?

Many of us tend to stare at a console / terminal screen for much of the day. What set of colors do you use on your terminal? Which do you find cause more eye strain / fatigue? I tend to find grey on black to be easiest on the eyes, but are there other color choices that may be more eye friendly? ...

How to update a printed message in terminal without reprinting (Linux)

I want to make a progress bar for my terminal application that would work something like: [XXXXXXX ] which would give a visual indication of how much time there is left before the process completes. I know I can do something like printing more and more X's by adding them to the string and then simply printf, but that would lo...

Clearing output of a terminal program Linux C/C++

I'm interested in clearing the output of a C program produced with printf statements, multiple lines long. My initial guess was to use printf("output1\n"); printf("output2\n"); rewind(stdout); printf("output3\n"); printf("output4\n"); but this produces output1 output2 output3 output4 I was hoping it would produce outpu...

Linux Terminal: how to capture or watch other terminal session

Let say i access to a server using ssh. In the same time there are another person access that server..is it possible to watch what is going on in that person's terminal..it's mean i can only watching what is he typing... ...

How do I split a large file in unix repeatedly?

I have a situation with a failing LaCie 500GB hard drive. It stays on for only about 10 minutes, then becomes unusable. For those 10 minutes or so I do have complete control. I can't get my main mov file(160GB) transferred off that quickly, so I was thinking if I split it into small chunks, I could move them all off. I tried splitting t...

Opening a remote file with TextWrangler

My current solution for editing files on a remote web server is to use Fetch to browse the remote machine and TextWrangler to make the edits. But since I'm getting more comfortable navigating the command line on the remote machine (but not comfortable enough to use VIM...), I'd like to be able to type something like 'open filename.txt' o...