get console window width: why ioctl always return 0 width?
Hi, all,
I use ioctl to get the cosole 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. Can anyonen tell me what is the problem and how to solve it? Thanks a lot. |
There is no window on the router. So it will always be 0 width. Unless you have some kind of GUI running on the router ?
|
Thank you for reply. I use PuTTY to login to this router. I mean the window size of this console window. Any idea?
|
All times are GMT -5. The time now is 05:46 AM. |