Programming :: Console Window Size - Why Ioctl Always Return 0 Width

Jul 1, 2010

I use ioctl to get the console window size (the SSH window). I use the following code:
struct winsize ws;
int returnValue = ioctl(pCommandStructure->terminal, TIOCGWINSZ, &ws);
int numberOfColumnsOfTerminalWindow = ws.ws_col;
When I debug on linux pc, it gives me the correct window width. But after I try it on router (this is my enventual place where my code shall run), ioctl always give me 0 width, that is, numberOfColumnsOfTerminalWindow == 0. but the returnValue is 0 which means that the function call succeeds.

View 2 Replies


ADVERTISEMENT

Programming :: Get Console Window Width - Why Ioctl Always Return 0 Width

Jul 1, 2010

I use ioctl to get the cosole window size (the SSH window).

I use the following code:

When I debug on linux pc, it gives me the correct window width. But after I try it on router (this is my enventual place where my code shall run), ioctl always give me 0 width, that is, numberOfColumnsOfTerminalWindow == 0. but the returnValue is 0 which means that the function call succeeds.

View 2 Replies View Related

Fedora :: Modify Ioctl TIOCMWAIT To Return The Same Thing That Ioctl TIOCMGET Returns?

Jul 4, 2011

I want to modify ioctl TIOCMWAIT to return the same thing that ioctl TIOCMGET returns. Currently wait returns an int of zero or -1 when a change in status occurs. Why not make it return the new status?

This will make the operation faster by not requiring another call to ioctl.The extra call requires 2 to 16 uSeconds to complete on my x64 laptop. How would I make this proposal to the kernal people?

View 1 Replies View Related

Programming :: Return Error From Ioctl Command?

Jul 21, 2010

I'm creating a usb device driver that needs to be able to read from two different endpoints. I couldn't see any way of having two read functions in the driver, so I got round this by reading from one of the endpoints with read, and the other with ioctl.However this hasn't worked, the ioctl call from c returns -1. I added a printk command in the driver in the ioctl function, however looking at kern.log I can see that this function is never being called. Does anyone have any ideas as to what the problem called be, or a better method of being able to read from two different endpoints?

View 2 Replies View Related

Ubuntu :: 10.4 - Setting Default Terminal Window Size To Screen Width

Oct 3, 2010

In 10.4 I had set my default terminal size to my screen width - I type some long commands. After running an update this morning, my terminal comes up in the install default size. Using the preferences dialog, I cannot find the control to set the default width. Has it been removed? I hope I'm looking in the wrong place, but I have a chilling feeling that it's been dropped or perhaps just accidentally commented out.

View 2 Replies View Related

Programming :: Get Width/height Of A Terminal Window In C++?

May 28, 2010

How do I find out how many characters fit into a terminal window horizontally and how many lines the terminal window is high (i.e. how many rows and columns are visible - the width and height)? I am using c++ and Linux Mint 8 - Gnome.

View 8 Replies View Related

Programming :: Adjust Table Width So That It Fits To Page Width

Mar 22, 2010

A couple of days I started using latex and have still one question about the table width. My table is too wide for a page. How can I adjust it so that it fits on the full width of a page? Can I use a command or do I have to specify each column widths by hand?

My table looks like this;

I did try several commands likeextwidth, esizebox, setlength but didn't found the solution yet.

View 2 Replies View Related

Ubuntu :: Change Width Or Size Of Application Launcher In Unity?

Apr 30, 2011

I just started the latest Ubuntu and like Unity a lot but I have a question about the application launcher.I have added a few applications to this launcher but the problem is it now takes up more than the screen. It seems if I scroll through it I can have it scroll down to use more applications.What I'd like to do is either make the application icons smaller so that they can all fit on the screen without me having to scroll or either make it wider so that there can be two vertical rows of application icons.Are there any options to do this or make any other changes to the application launcher?

View 3 Replies View Related

General :: Get The Tmux Window Full Width?

Jun 21, 2011

tmux shows screen like this:

[code]...

Window has non-maximum width, attempt to copy text from it leads to "" getting in text. How to fix it and get the tmux window full width?

View 2 Replies View Related

Ubuntu :: Equivalent To DOS's WIDTH Statement - Make The Font Size Smaller?

Jul 22, 2010

Each version of Ubuntu I've used, the size of the text in the virtual consoles (Am I allowed to call it "screen resolution" if it's a CLI?) has varies widely; some versions had the consoles in 80x24 text mode while others used much higher resolutions.this version of Ubuntu seems to use 80x24 characters, which looks really ugly on my 17" screen. Is there any way to make the font size smaller? QBASIC had a WIDTH command to change the number of rows and columns of characters,

View 2 Replies View Related

General :: How To Customize Width Of Window Tabs In Kde Task Bar?

Mar 27, 2010

My task bar is quite broad. so when ever i open more than 6 windows at a time then the task bar adjusts the tabs in two row. how can explicitly specify the width for those tabs. so that they all fit in one line.

View 1 Replies View Related

Ubuntu :: Change 'line Width' For Window Edge Resizing?

Dec 2, 2010

This has bugged me forever.....and I mean really bugged me. The 'pixel width' is too low, such that trying to get my mouse to line up just perfectly on the window edge to get the resize icon, is very difficult. After a bit of searching, I discovered Alt F8, which, for those that don't know, is a resize shortcut and works very well, however, I will still use the 'edge resizing' option quite a bit, and would like to widen the 'line' a few pixels. Is this possible in a user settings file, or is this hardcoded? I am learning to develop, so I wouldn't mind looking into this one as a beginning project. If that's the case, could someone point me to the appropriate package?

View 5 Replies View Related

General :: How To Change X-Windows Default Border Width For All Window Frames In Ubuntu

Jun 14, 2010

Way back from Windows 3.x days to the latest 64bit Windows 7 (classic/standard theme)there is a way to make the window edge border wider then 1 pixel.I often use 3 to 5 pixel to make it easy to grab on hi-resolutions displays and hi DPI monitors.There doesn't seem to be an easy or obvious way to do this with the Gnome X-Windowing system?

View 3 Replies View Related

Software :: Start The Jboss And Return To The Command Console?

May 25, 2010

Normally one can start the Jboss with

Code:

./run.sh -c server-name

But in this way the command console will keep hang. Now I want to write a script which calls u this command and return back to the command console. Here is what I wrote but it doesn't return back to the command console:

Code:

#!/bin/sh
MSGBP_HOME="/opt/jboss/MSGBP"
case "$1" in
start)

[code]...

View 1 Replies View Related

Programming :: IOCTL Error - To Get The Ssid Through C Program

Feb 28, 2011

I was trying to get the ssid of WLAN through the following C program

What is the cause of this error?

View 1 Replies View Related

Programming :: Writing And Reading Driver Value In Ioctl?

Jan 18, 2011

I just want to read and write some values (integer) to my driver. I used put/get user but always getting errors.

driver

Quote:

int Wert;
static int device_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsinged long arg)
int ret;

[code]...

Quote:

int WERT
ret=ioctl(fd, SETIT, WERT)
ret=ioctl(fd, GETIT, WERT)

if i say in C++ WERT is 5 the value arg of the driver becomes 5 but not WERT the returnvalue of get and put user is -1 so it failed.

View 12 Replies View Related

Ubuntu Multimedia :: Screen Recorder - Can Select The Window/window Size The Axis

Jul 17, 2011

I have asked for a video capturing software before but recommend a GOOD screen recorder where you can select the window/window size the axis and also a good editing software which will render/export into FULL 720p HD

View 2 Replies View Related

Ubuntu :: Unable To Define A Default Window Size Of A New Terminal Window?

Nov 16, 2010

i'm not sure for using the correct channel here but i hope someone out there can answer my little questions. 1st in older version i was able to change the settings of the terminal look as the font color, background color and so on. I was also able to define a default window size of a new terminal window. But since after upgrading to to the first release this year and a complete new installation of the current release Maverick i do not find this option anymore. Is there a way how to set up the terminal default window size?

View 9 Replies View Related

Programming :: Find The Device Name For Ioctl (sd, SIOCGIFINDEX, &ifr) Call?

Feb 12, 2010

Hi I am trying to add the device by using followig code strip and it says that eth1 is not defind in the code.

strncpy(ifr.ifr_name,eth1,IFNAMSIZ);
if (ioctl(sd, SIOCGIFINDEX, &ifr) == -1) {
return 0;
}

How do I write down the DEVICE name in the ifr.ifr_name structure ?

View 2 Replies View Related

Programming :: Ioctl TIOCMGET Call Doesn't Detect TIOCM_CTS

Apr 6, 2011

I am having the following problem. The following code works fine on my P.C. Ubuntu x64, and on a jetway mini-itx board with an atom processor. The problem is, the same code doesn't work on the intel equivalent of the jetway board. I thought the maybe, I didn't have the port configured right, so I turned on Hardware Flow control and also tried turning on the modem bits I needed with TIOCMBIS. Neither worked. Here is the code. There are two threads, one of them, respsponding to the client, and using the RTS and DTR pins to power two relays. The other, manages listening to CTS and DSR for input. Here is the class with the first thread.

Code:

/*
* DigitalIOCore.cpp
*
* Created on: Nov 1, 2010
* Author: jonathan

[code]....

View 9 Replies View Related

Programming :: How To Find Out Width Of Terminal

Mar 19, 2010

I wonder how CLI applications know the width of the terminal. For example, how does ls know how many columns to use?

How do package managers like pacman know what length to make the download progress bar?

Also, how do they redraw the progress bar in the same line?

View 11 Replies View Related

General :: Split A String Into Array In Bash Return Wrong Size?

Mar 21, 2011

I'm trying to split a string, to later iterate using a for loop like

Code:
for (( i=0; i<5; i++))

But, my script returns an array with the size 1.

Here's the script:

Code:
aver=$(grep "avg" A.txt | awk '{ print $2 }');
a=$(echo $aver | tr " " "
");

[Code]....

View 2 Replies View Related

Programming :: Get String Width In Pixels In Xlib?

Aug 3, 2009

I'm trying to get the width of a string in pixels this way:

Display *disp;
int len;
disp = XOpenDisplay(0);
font = XLoadQueryFont(disp, desc );

[code]....

I'm getting negative numbers as the the pixel length, eg -7275

View 3 Replies View Related

Programming :: Use Awk And Sed To Extract Height And Width Of File

Aug 3, 2010

I am trying to write commands that extracts the height and width of a video file via ffmpeg. I have the following working so far:

This gives the following answer in widthxheight format with an extra , 720x480,

How can I instead run 2 separate commands that give me height and width separately? I want some command to give me 720 and another command to give me 480 and I dont need the x or the ,

If you need to know this is what ffmpeg -i videofile.mov 2>&1 gives as output

Seems stream 0 codec frame rate differs from container frame rate:

At least one output file must be specified

View 6 Replies View Related

Programming :: Fortan Error - Nonnegative Width Required In Format String At - 1

Jun 10, 2010

I'm in the process of debugging and compiling about sixty FORTRAN 95 programs and could use a little bit of your help before my brain is fried and fingers are cramped. Thanks for your time!

I receive the following errors:

Here is my code:

View 5 Replies View Related

Programming :: Termios Programming - Without Removing Carriage Return / Enter Key

Jun 30, 2010

I trying to write a UART(interfacing of serial devices) to linux machine but after I execute the following code to receive data I need to enter key (carriage return).... but I don't want to remove carriage return/enter key

[Code]....

View 13 Replies View Related

General :: Increasing Font Size In Console

Feb 26, 2011

I am using ubuntu lucid.as a desktop and don't run a server. The editor I use is vim so increasing font by edit > profile preferences. What I need to know is how to increase the size in console ie. when I use Ctrl +Alt + F1 to F6. On running xrandr I get this :

[Code]...

I know that,the graphical user interface ( using X windows , I think ) sits on top of the base system ie F1 to F6. In the Fs , xrandr replies "Can't open display ". The question is am I right in thinking that "gui" is totally independant of the base ( is that the correct word ?). I have read that messing about with resolution can wreck a monitor ( I'm using a laptop) , is there a safe way to proceed?

View 5 Replies View Related

Debian :: Lenny - Changing Console Font Size?

Dec 31, 2010

So I set up that OS I was talking about, everything I need, staying away from the "Startx" command, and it's working very very awesomely except for ONE little problem. The console font size is too big for me, and honestly I don't know how to change that. Coming out of Ubuntu, I'm realizing I don't know as much about config files as I think I do :P

Any way I can change the font size? When I use the GParted live cd, I see a line in the start up that mentions changing the frame buffer to 700 x 48 or something, I'll get specifics soon (computer's not on me) and it makes the font and everything just how I like it.

View 9 Replies View Related

Fedora :: Text Size In Console Got Sidetracked To Discussing Fbterm?

Jan 7, 2011

A thread on text size in console got sidetracked to discussing fbterm. In an effort to not (further) hijack that thread, I've started this one.[URL].. Anyway, I was asked how I got ibus-fbterm working. I only really got it working in ArchLinux, not Fedora, but I suspect if someone works enough at it, they can get it working in Fedora as well. I do a minimal installation, installing X and fluxbox or openbox. One also needs to have framebuffer working--if you have nomodeset in grub, due to, for example, using an NVidia driver, this won't work. You will have a /dev/fb0. In Arch, this is owned by root:video. When installing fbterm, there's a message that one should add themselves to the video group in order take advantage of this.

I used it with ibus-anthy. First, I made sure that that worked properly in X. I then installed fbterm and ibus-fbterm. So, to get it working, first be sure that ibus and your desired input method is working in X. Then, you have to have rights to /dev/fb0--in Arch, this was easy, making myself a member of the video group, not sure about the best way to do it in Fedora. As a temporary experiment, I just did a chmod 777 on it, which is obviously not the best solution.

Now in console, start ibus
ibus-daemon --xim
Before running fbterm, run the command
setcap 'cap_sys_tty_config+ep' /path/to/fbterm

as root or with root privilege. In Arch, the setcap command was there, in Fedora, I had to install it. I'm afraid I forget what program provided it, I had to use yum provides */setcap Then call ibus-fbterm with ibus-fbterm-launch You'll see that your console looks slightly different. Now, if it works, you should be able to hit ctl+space and then input the language of your choice (in my case Japanese.) In Fedora, it didn't work. I would hit shift space and enter characters, but nothing happened.

In Arch, it was a bit better--I'd hit ctl+space and enter something. Then, when I hit enter, I would see the results of what I'd typed. I couldn't edit it until I'd left input mode by hitting ctl+space again. That is, after hitting enter, I'd see the result of what I typed, but couldn't backspace.or otherwise go back. What it would do is, when I was trying to select kanji, by hitting the space bar after t yping the phonetic, is, after the second or third hit of the space bar, it would show the kanji choices and I could pick one.

View 8 Replies View Related

Ubuntu :: 9.10 - Console Resolution High And Font Size Small

Jan 3, 2010

I am have upgraded from 9.04 to 9.10 in my laptop. After performing the reboot, the shell/console resolution went very high and the font size went too small. How to regain the old console shell resolution as in 9.04. I require this urgently as my laptop suffers the white screen problem. Switching between Ctrl+Alt+F6 and Ctrl+Alt+F7 I could get back the screen as the change in the resolution switches off and on the screen, so that I can negotiate with the white screen problem.

View 10 Replies View Related







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