Find the answer to your Linux question:
Results 1 to 10 of 10
I'm having a problem when invoking the shell within emacs. The problem is how the output is displayed in the emacs window. Here's a clear example of the problem. http://rplaca.cs.qc.edu/~bpark/emacs_shell.jpg ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    emacs, shell


    I'm having a problem when invoking the shell within emacs. The problem is how the output is displayed in the emacs window. Here's a clear example of the problem.
    http://rplaca.cs.qc.edu/~bpark/emacs_shell.jpg
    As you can see, the display is distorted. Does anyone know how I can fix this problem? From what I can tell, they look like vt100 characters but I'm not too sure about it.
    The best things in life are free.

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    If you try /bin/ls instead, it'll probably work. It's most likely because ls is aliased to "ls --color=tty". Try to unalias it.

  3. #3
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    it is probably aliased to --color=always. ls usually recognizes when it is in a shell that doesn't understand the color codes, and tries to dumb itself down. Or it might be an emacs bug along the lines of "color codes aren't implemented". I think color codes are implemented, but there is something up with emacs. Don't know, not a big emacs user.
    I respectfully decline the invitation to join your delusion.

  4. #4
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    right on

    Hey guys,

    Both of you were right on regarding this matter. I should have suspected that the color would have been the problem but I was rather perplexed looking at those characters.
    Do either of you know how I can invoke the shell without invoking .bashrc within emacs? I still like the color mode when I am using konsole and all.
    The best things in life are free.

  5. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Try adding this to your .bashrc instead:
    Code:
    if [ "$TERM" = dumb ]; then unalias ls; fi
    Or, if you're using RH8 (why can't I ever remember what distro anyone is using?), you could create an empty file named /etc/DIR_COLORS.dumb, and it will fix it for you.

  6. #6
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    Dolda is a linux guru

    Dolda,

    Is there anything that you don't know? Had I known anyting about the env variable $TERM being set to dumb, I would have done this. Thanks for solving this problem for me. By the way I am using Debian. I'll post that information next time I post something else.
    The best things in life are free.

  7. #7
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    I think it would be a good idea to display a user-definable "Distro" entry beside the current "Location" one. Would it be possible for you to set that up, sykkn?

  8. #8
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    By the way, bpark, to be entirely "correct", I'd recommend you to examine how the system-wide profile scripts alias ls and fix it there. The script is /etc/profile.

  9. #9
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    /etc/profile ....

    Dolda,

    /etc/profile contains absolutely no information about ls and the color mode. It has to do with my .bashrc file inside the home directory. Is it different in Redhat 8?
    The best things in life are free.

  10. #10
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Indeed it is. I don't know if your /etc/profile does the same, but mine also sources all files that are globbed by /etc/profile.d/*.sh, and one of them is /etc/profile.d/colorls.sh, which sets up everything that has with it to do.
    I don't know which is smarter really... Debian's system does make it easier for the individual users to set it up, it would seem, while RedHat's allows the sysadmin to change implementation details whenever and then just change one file so that it works for all users. I guess it's all about what you prioritize.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •