You are not logged in.
Hello everyone. Since about 15 days ago, probably after some update, I noticed small change in Emacs shell mode behavior (M-x shell). When I am downloading some packages with pacman I don't have progress bars and download percentages anymore. It happens only in Emacs shell. Xterm and other non Emacs shells are fine. Do anyone have the slightest clue about what's wrong? Thank you for help in advance. Cheers!
Some pics to clarify my problem:
http://img52.imageshack.us/img52/5224/2 … 0x1024.png
vs.
http://img861.imageshack.us/img861/414/ … 0x1024.png
p.s. I have only output problems with pacman. Yaourt, for example, is doing fine.
--mod edit: use thumbnails, see https://wiki.archlinux.org/index.php/Fo … s_and_Code
Last edited by litemotiv (2011-08-09 09:12:59)
Offline
Going to guess that this happened with the 3.5.3 upgrade, perhaps due to this commit. If that's the case, I'd be curious to know if backporting this commit solves it.
Could you perhaps compile the following program and post the output? You can save it as ttytest.c and use the first line of the source file to compile and run it.
/* gcc ttytest.c -o ttytest; ./ttytest */
#define _GNU_SOURCE
#include <sys/ioctl.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
int getcols()
{
int termwidth = -1;
const int default_tty = 80;
const int default_notty = 0;
if(!isatty(fileno(stdout))) {
return default_notty;
}
#ifdef TIOCGSIZE
struct ttysize win;
if(ioctl(1, TIOCGSIZE, &win) == 0) {
termwidth = win.ts_cols;
}
#elif defined(TIOCGWINSZ)
struct winsize win;
if(ioctl(1, TIOCGWINSZ, &win) == 0) {
termwidth = win.ws_col;
}
#endif
return termwidth <= 0 ? default_tty : termwidth;
}
int main(void) {
char *term = getenv("TERM");
if (term) printf("TERM=%s\n", term);
printf("isatty(fileno(stdout)) = %d\n", isatty(fileno(stdout)));
printf("getcols() = %d\n", getcols());
return 0;
}
Offline
Falconindy: I think you are right about 3.5.3 version upgrade. I am pretty sure I saw those numbers back then.
Ofcourse I can post the output.
TERM=dumb
isatty(fileno(stdout)) = 1
getcols() = 80
Thank you for your help.
Offline
So, the bad news is, it looks like shell mode in emacs makes a truly poor and incapable terminal. It appears to be the equivalent of a serial console, with the added "bonus" that it doesn't even set a TERM name (and therefore inherits the 'dumb' value).
The good news is, this should be fixed in 4.0. The second patch I picked out is indeed the fix, but wouldn't be a straight backport as it touches some features only present in git master.
Offline
So, the bad news is, it looks like shell mode in emacs makes a truly poor and incapable terminal. It appears to be the equivalent of a serial console, with the added "bonus" that it doesn't even set a TERM name (and therefore inherits the 'dumb' value).
The good news is, this should be fixed in 4.0. The second patch I picked out is indeed the fix, but wouldn't be a straight backport as it touches some features only present in git master.
Thank you man. Those are great news.
Offline
M-x shell is very simple. If you want fuller terminal emulation, you can use M-x term , which shows the progress bar just fine.
Offline
Error post
Last edited by marko-v (2011-08-09 01:40:09)
Offline
M-x shell is very simple. If you want fuller terminal emulation, you can use M-x term , which shows the progress bar just fine.
I can't switch buffers when in term mode.
Offline