Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

how to change xterm buffer size

Hi,

I use X11 most of the times in my research. I found the fact that the xterm in X11 (OS X tiger) by default only stores 64 lines that is "scrolled" out and above of the terminal window. This is rather inconvenient since for some large directories, a simple command like "ls" will push much of the contents out of the xterm buffer and you will not able to view them unless you redirect them into a file.

I know that one can open a new xterm window by using:

xterm -sl 1000 &

so you get 1000 line buffer in stead of the default 64.

However, I would also like the initial window to have a 1000 line buffer as well. This saves time and effort to open a new xterm and close the initial one.

Does any one know how (or if) one can do this, for example by setting certain enviroment variables in the .bashrc file (I use bash most of the times)?

Thank you very much,

Lianheng

Powerbook G4 12", Mac OS X (10.4), Dell PC Windows XP

Posted on Mar 20, 2006 4:26 PM

Reply
10 replies

Mar 21, 2006 12:10 PM in response to Gary Kerbaugh

Hi Gary,

Thank you for your suggestion. Could you help me more about the .xinitrc file?

I don't have a .xinitrc in my home directory. So I created one but not very sure what to write inside it. I first tried

xterm -sl 1000 &

X11 failed to start after that, so i changed the line to just

-sl 1000

And again X11 crashes at start.

May be there is the root one in /etc directory that I can copy to home. But somehow I think this may not be the way to go. So could you give me some more advises?

Thanks,

Lianheng

Mar 21, 2006 2:09 PM in response to tong

Hi Lianheng,
I'm sorry that I didn't reply right away because I was at work. It's probably a good thing though because I like Daniel's idea better. Of course you'll have to create that file as well.

Actually you shouldn't create the ~/.xinitrc; you should copy the template with the command:

cp /etc/X11/xinit/xinitrc ~/.xinitrc

Then you can edit it as you like. When you don't have such a file, X11 uses the template but after you execute the above command it will use the new one. There is no template for the ~/.Xresources file so if you don't already have one, you can do what Daniel suggests with the command:

echo 'XTerm*saveLines: 1000' >> ~/.Xresources

--
Gary
~~~~
Organic chemistry is the chemistry of carbon compounds.
Biochemistry is the study of carbon compounds that crawl.
-- Mike Adams

Mar 21, 2006 3:45 PM in response to Gary Kerbaugh

Thank you for you all for giving me so much help!

I tried both methods. The method using .xinitrc worked!

However, for some strange reason, X11 seemed not to respond to ~/.Xresources. (Of course, once again, I just put in one line in this file). The buffer size is still 64. But I can see why changing the buffer size using .Xresources is a better method. Anyway, I think I have got access to the .Xresources file in my departmental server, I will have a look at that and see what may have been the cause of the problem.

Thank you very much!

Lianheng

Mar 21, 2006 4:01 PM in response to Daniel Macks

I actually deleted the .xinitrc when I tried the .Xresources method. And I have just read the default xinitrc file, and it does contain commands to load the .Xresources.

However, this is what I have also discovered, in the defaut XTerm file, which has path:

/etc/X11.AppleBackup/app-defaults/XTerm

(that X11 dir is the only one I can find in /etc )

in XTerm, there is no line containing

*saveLine

is this relevant?

Mar 21, 2006 5:27 PM in response to tong

I have solved the problem!

The problem is exactly the strange directory name for my X11 in /etc. All links in the /usr/local/X11R6/ are pointed to /etc/X11, but in fact no such directory exsist on my machine, and hence not even the default xinitrc read.

So, my temporary fix is to copy the .xinitrc template to ~/, and it worked.

I am thinking may be I can put a symbolic link

ln -s X11 X11.AppleBackup

in /etc ?

Any suggestions for a better method? Of course I can also change the dir name, just afraid some programs may depend on that name.

Mar 22, 2006 9:18 AM in response to tong

Sorry, just to correct my previous comment:

The command to use to create symbolic link in /etc should be:

ln -s X11.AppBackup/ X11

After I did this, It actually solved many of the other problems associated to my xterm. It is some how strange, why my /etc/X11 is named differently.

Lianheng

how to change xterm buffer size

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.