tags:

views:

61

answers:

3

In setting up my personal Linux command line development environment, I want to use term inside emacs b/c then I can switch to 'line mode' and copy/paste the output into any other buffer.

However, when I run mysql inside term inside emacs, the pretty sql tables still word wrap according to the width of that emacs window :(. I was hoping that emacs would truncate the bash output.

Is there a way to do this?

EDIT:

toggle-truncate-lines is on, so "word wrap" is off, but the problem is that before emacs even does anything with the text, the underlying bash process itself manually adds newlines to wrap text according to the width it's told it's using. That's at least how it acts. toggling truncate lines on/off doesn't change anything for me in the term buffer

A: 

I think what you probably want is "M-x toggle-truncate-lines". That toggles between wrapping or requiring you to scroll right and left to see the entire line.

JOTN
+1  A: 

You probably want to add something to the sql hook to turn off the wrapping:

(add-hook 'sql-interactive-mode-hook '(lambda () (toggle-truncate-lines 1))
Trey Jackson
A: 

I think Emacs might be setting the COLUMNS environment variable to indicate when the shell should wrap lines. Try setting it to a very large value and see if that helps.

I have no idea what other things this will break though.

Joakim Hårsman