General :: Keyboard Does Not Work In **Ubuntu Terminal **whilst Writing A Source Code?

Aug 29, 2010

I have installed a Virtual machine.I use Virtual Box for the same. My host OS is Windows XP SP3. I have assigned it 500mb of Ram and it works fine. But my problem is that my Keyboard does not work in Ubuntu terminal whilst writing a source code.

When I use the arrow keys it gives me alphabets A B C D. And also when i press a . it acts as a backspace.I have a cordless Logitech Keyboard.I don't know why my keyboard isn't functioning inside the Terminal (& that to only whilst typing in source codes) I have tried changing the Character Encoding but thats not helping.

View 2 Replies


ADVERTISEMENT

Programming :: Psuedo Terminal - Cannot Add Fflush To Source Code

Feb 22, 2010

I have a problem in programing pseudo terminal. In the book APUE (advanced programing in the unix environment) in chapter 15.4: coprocess gives an example of using pipe to operate another program, that provide its input and read its output: Figure 15.18. Figure 15.19 is filter to add two numbers using standard IO. The author said that you must flush the IO buffer in the program which are operated through pipe by another program, however, we cannot add fflush to the source code and re-compile the whole program if we need to use it in another process. It said that pseudo terminal can solve this problem, but I have tried in fedora12 with forkpty call and fail. Source code as follows:

The main process:
Code:
#include "common.h"
#define LINESIZE 256
int main()
{
int fd[2];
pid_t pid;
if( socketpair(AF_UNIX, SOCK_STREAM, 0, fd)<0 ) {
perror("create socket error");
exit(1);
}
int master;
struct termios tm;
if( tcgetattr(STDIN_FILENO, &tm)<0 ) {
perror("tcgetattr error");
exit(3);
}
struct winsize size;
if( ioctl(STDIN_FILENO, TIOCGWINSZ, (char*)&size)<0 ) {
perror("ioctl error");
exit(4);
}
setbuf(stdout, NULL);
pid=forkpty(&master, NULL, &tm, &size);
if( pid<0 ) {
perror("create process error");
exit(2);
}
else if(pid>0) {//parent
close(fd[1]);
char line[LINESIZE];
memset(line, 0, LINESIZE);
while( fgets(line, LINESIZE, stdin)!=NULL ) {
write(fd[0], line, strlen(line));
memset(line, 0, LINESIZE);
int n=read(fd[0], line, LINESIZE);
if(n>=0) line[n]=0;
printf("%s", line);
memset(line, 0, LINESIZE);
}
} else {//child
close(fd[0]);
if( fd[1]!=STDIN_FILENO ) {
if(dup2(fd[1], STDIN_FILENO)!=STDIN_FILENO) {
perror("dup2 error");
exit(1);
}
}
if( fd[1]!=STDOUT_FILENO) {
if(dup2(fd[1], STDOUT_FILENO)!=STDOUT_FILENO) {
perror("dup2 error");
exit(2);
}
}
close(fd[1]);
if(execl("./add", "add", (char*)0)<0) {
perror("exec error");
exit(3);
}
exit(0);
}
//parent
wait(NULL);
return 0;
}
The add program reads a line and get two numbers and return the sum of them.

Code:
#include "common.h"
int main() { int n1, n2;
char line[256];
memset(line, 0, 256);
while( fgets(line, 256, stdin)!=NULL) {
sscanf(line, "%d%d", &n1, &n2);
printf("%d", n1+n2);
fflush(NULL); /*the program does not work without this sentence why?*/
memset(line, 0, 256); } return 0; }

View 5 Replies View Related

Ubuntu Installation :: Compileing The Source Code In The Terminal - Cannot Open: No Such File Or Directory

Apr 13, 2011

I've tried a couple times to install from a tar.gz file and when i try to compile the source code in the terminal I get this error "tar: bash-4.2.tar.gz: Cannot open: No such file or directory" what am I doing wrong? Now when I download the files, I leave themin the down loads folder, do i need to make a new directory? If so how do I do that and how do i call it up when I compile the sopurce?

View 1 Replies View Related

Software :: How To View And Work With Source Code

Jun 18, 2011

I have been using Linux for a number of years, and I am reasonably adept at installing, updating, using, and fixing problems in it. I am currently using Fedora 15 as I like the "bleeding-edge" stuff, but I have finally come far enough that I want to learn about writing and manipulating source code. I am trying to teach myself c++ and have all the necessary compilers librarys etc.

View 2 Replies View Related

Networking :: Modify Ftpd Source Code To Work With Xinetd?

Sep 23, 2010

I read that xinetd listens on the service port and passes incoming traffic to the service (ftpd) via stdin. However, the ftpd source code reads its input from a socket not from stdin.

Am I to conclude that in order to be managed by xinetd, the source code for ftpd (or telnetd etc..) must be modified or recompiled to take its input from stdin??

View 1 Replies View Related

Ubuntu :: Terminal Keyboard Shortcuts Don't Work In AWN?

Nov 25, 2010

I'm unsure as to how I can use keyboard shorts to close the current tab or to switch between tabs. Does anyone know them or know any other keyboard-based options for using the terminal in AWN? I can open a new tab by ctrl+shift+t but ctrl+shift+w doesn't work and i've never known how to switch between tabs

View 4 Replies View Related

Ubuntu :: Keyboard Dont Work In Terminal-tty?

May 1, 2011

True terminal is: ctrl + alt + F1-F6, F7 to exit if you don't know what i mean by using true terminal term. My keyboard work everywhere else.

View 3 Replies View Related

General :: Writing Commands In Terminal Do Nothing

Sep 29, 2010

When i Write commands in terminal it does nothing

View 1 Replies View Related

Ubuntu :: Source Code Of The Krnel From The Kernel.org - Source Trees Organization

Apr 11, 2011

i am already a little bit familiar with linux and now i want to know better the linux OS. i have downloaded the source code of the krnel from the kernel.org and i dont understand the linux source trees organization, so can somebody do me a favor and give me a link to some internet page (or at least a book) that explains that?? i have searched in the internet with the tag:::linux source trees organization and i have not found nothing interesting

View 1 Replies View Related

Ubuntu :: How To Enter Password / Terminal Keyboard Doesn't Work

May 22, 2010

How do you enter your password terminal the keyboard doesn't work when I try

View 2 Replies View Related

Ubuntu :: How To See Source Code Of Open Source Software

Sep 12, 2010

I want to see the source code of smplayer software.from where i can see source code of open source softwares?

View 9 Replies View Related

General :: Need Source Code For Gprof

Jan 17, 2010

I need GNU gprof source code. I have searched on Internet but didn't find anywhere. Can any give me the link for downloading the same?

View 3 Replies View Related

General :: Red Hat Enterprize - Can To Get It's Source Code?

Mar 22, 2011

Is red hat enterprize linux is open source and if yes from where I can get it's source code?

View 2 Replies View Related

General :: How To Install From Raw C Source Code?

Mar 13, 2011

I am trying to install the tightVNC on my imac.It expects X install; I see that X11 in my utility. I think it is ok, but the instruction states to install it on /usr/bin/. Which is correct?Then I need to have ~JPEG and ~zlib to place in /usr/bin/ or inside of certain folders to use.To make sure it is ok; I put both of them in both of the indicated places. I assume it is going to work.Now, I am suppose to build and install. I am not sure how to do it with the command "xmkmf" and not sure where to run this command.I am doing all of this in terminal.

View 1 Replies View Related

General :: Source Code For Free Command?

Dec 8, 2009

Where is the source implementation of the free command?

View 2 Replies View Related

General :: Error Trying To Patch Source Code

May 15, 2010

I'm running spamassassin and want to install the fuzzyocr module for it. One of the dependencies of fuzzyocr is 'giflib' but according to the fuzzyocr page, it needs to be patched before I install it, with a patch which they supply on the fuzzyocr download page. I've tried to install the patch and get the following error.

[Code]...

View 3 Replies View Related

General :: How To Compile A Linphone 3.3.2 Source Code

Mar 13, 2011

I've created a GUI for my voip software wherein i'm using the source code of linphone 3.3.2 for video and all protcol stuffs . It is like i've got my own gtk GUI instead of the linphone's glade . Hope you get the picture of what i'm doing . I would like to know how to compile the source code since because i do not know about make files and stuffs . Kindly help me solve this .

View 2 Replies View Related

General :: View The Source Code Of Different Commands

Jul 24, 2010

i want to see the source code of different commands .how they are working ??for ex why ls is listing all the files and directory .what code is written for ls so that it is listing like this.where the source code is kept by the os

View 2 Replies View Related

General :: Installing Mysql On Vps From Source Code?

Mar 3, 2011

I just tried installing mysql on my vps from source code. after untaring the source code. when i tried to configure the ./configure script. iwas not able to find it. it is not there.

View 1 Replies View Related

General :: Run The Source Code Of Virtual Box In Windows?

Dec 2, 2010

Website through were I can learn Python,SQL & How can I run the Source code of Virtual Box in Linux & windows

View 2 Replies View Related

General :: Source Code Of Leach Protocol For NS2?

Jun 11, 2011

I need source code of leach protocol for NS2

View 1 Replies View Related

General :: Where Source Code Of Kernel Located

Feb 6, 2011

Want to know where the source code of Linux is located

View 2 Replies View Related

General :: Finding The Kernel Source Code?

Apr 14, 2011

where can i find linux kernel source code?

View 4 Replies View Related

General :: Including Lzo Compressor Library In Source Code?

Apr 11, 2010

I have downloaded lzo-2.00 package and have installed it linux kernel 2.6 version. Now I want to include the lzo library in the source code of linux.According to the instructions given in the package, I have copied the files (minilzo.c,minilzo.h,lzoconf.h,lzodefs.h)in the source directory(/mm),added minilzo.o to my Makefile and have included(#include minilzo.h) from my program. But when I compile the kernel,I am getting errors.

Errors:

->limits.h:No such file or directory
->assert.h:No such file or directory

View 3 Replies View Related

General :: Requirement Of Source Code For Intra-Domain

Feb 9, 2011

I am in urgent requirement of free simulation source code for Intra-domain. Mobility Management in OMNETT++ or NS2. Where I can post queries for OMNETT++.

View 1 Replies View Related

General :: Where To Found Source Code For Echo Command?

Dec 1, 2009

Can any body tell me where can i found the source code for echo command. so that i can download it such that it can help me for further studies on echo command

View 8 Replies View Related

General :: Error While Installing 2.6.31 Source Code In Fedora 12

Apr 13, 2010

while installing the linux-2.6.31 source code in fedora 12 I got an error:
[root@pratyush linux-2.6.31]# make install
sh /home/parag/rpmbuild/SOURCES/linux-2.6.31/arch/x86/boot/install.sh 2.6.31 arch/x86/boot/bzImage
System.map "/boot"
/sbin/new-kernel-pkg: line 277: /sbin/mkinitrd: No such file or directory
mkinitrd failed

View 2 Replies View Related

General :: How To Get Source Code Of Web Page From Command Line?

May 6, 2010

I'm trying to get the source code of a web page from linux command line and save it to a file. I googled for it but didn't get any info. I'm not sure if wget can do this.

View 4 Replies View Related

General :: How To Recompile Any Source Code Of Software To Install It?

Mar 23, 2010

I have fedora 12 on my laptop and I am unable to recompile the source code of flash player. please answer me as soon as possible.

View 2 Replies View Related

General :: Source Code Or The Procedure For Creating Own Shell?

Nov 3, 2010

i need the source code to create my own shell in linux or provide atleast procedure for doing it

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved