LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-23-2011, 02:47 AM   #1
jgombos
Member
 
Registered: Jul 2003
Posts: 256

Rep: Reputation: 32
emacs in terminal-mode constrains output to 80 columns (emacs bug, or watch bug?)


If emacs is in terminal-mode, it seems to constrain some tools to 80 columns of output, but not all tools. E.g. The following will correctly show 85 x's:
Code:
emacs -nw --eval='(terminal-emulator "*echo only*" "echo" '"'"'("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"))'
But if you run watch inside an emacs terminal and use it to print 85 x's, wrapping will happen at column 80, even though there is actually plenty of width. E.g.
Code:
emacs -nw --eval='(terminal-emulator "*echo nested inside watch*" "watch" '"'"'("--interval" "3600" "echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"))'
What am I missing?

At first I thought the problem was with the watch command. However, this correctly shows 85 x's without wrapping:
Code:
watch --interval 3600 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Last edited by jgombos; 05-25-2011 at 01:30 AM.
 
Old 06-17-2011, 09:49 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,793

Rep: Reputation: 2086Reputation: 2086Reputation: 2086Reputation: 2086Reputation: 2086Reputation: 2086Reputation: 2086Reputation: 2086Reputation: 2086Reputation: 2086Reputation: 2086
Quote:
If emacs is in terminal-mode, it seems to constrain some tools to 80 columns of output, but not all tools.
It seems like watch can't figure out the terminal width under emacs and defaults to 80 columns, not that it's being constrained. If you tell it the width it works as expected:
Code:
COLUMNS=85 emacs -Q -nw --eval='(terminal-emulator "*echo only*" "watch" '"'"'("echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"))'
I'm not sure what mechanism watch uses to discover the width under a normal terminal, but the fact that it fails under emacs suggests a bug in emacs to me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
find out If distro is running in live mode using terminal based tools tank junior Linux - Newbie 7 05-10-2011 08:11 AM
emacs + auctex - opening output PDF inside emacs buffer coenvh Linux - Newbie 1 04-29-2010 05:52 AM
trying to add df output columns help alienmindvision Programming 5 06-06-2009 12:34 PM
Alt no longer META key when using in-terminal option of Emacs (emacs -nw) frznchckn Linux - Software 1 06-02-2007 02:41 AM
Removing Columns From Output darthtux Programming 4 08-01-2004 09:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration