# really useful Xterm, Aterm and URXVT features (GNU Screen)

## Xk2c

 :Arrow: _  Xterm

since I read threads on this subject, I was playing around to find some good features.

Now I´ve them put here all together.

from man aterm:

```
Note that when reading X resources, aterm recognizes two class

names: XTerm and Aterm. The class name XTerm allows resources 

common to both aterm and xterm to be easily configured,  

while the class name Aterm allows resources unique to aterm
```

from man urxvt:

```
Note that when reading X resources, urxvt recognizes two class

names: XTerm and Rxvt. The class name XTerm allows resources

common to both urxvt and xterm to be easily configured,

while the class name Rxvt allows resources unique to urxvt.
```

This means these features here will also apply to Aterm and rxvt-unicode.   :Wink: 

```
xterm -ls -j -s -fa "Bitstream Vera Sans Mono" -fs 11
```

from man xterm:

```
-j      This option indicates that xterm should do jump scrolling.

        Normally, text is scrolled one line at a time; this option

        allows xterm to move multiple lines at a time so that it does

        not fall as far behind. Its use is strongly recommended since

        it makes xterm much faster
```

```
 -s    This option indicates that xterm may scroll asynchronously,

       meaning that the screen does not have to be kept completely up

       to date while scrolling. This allows xterm to run faster
```

alternatively to -j -s put this in ~/.Xdefaults:

```
XTerm*jumpScroll:               true

XTerm*multiScroll:              true
```

only with this two options enabled you will decrease the emerge time, since xterm scrolles much faster.

try it  :Wink: 

You can just add any off this to your ~/.Xdefaults and then do 

```
xrdb -load ~/.Xdefaults
```

to activate it immediately. Just fire up a new Term then.

If you don´t want to show up Bold characters as bold (what makes it difficult to read), then add:

```
XTerm*boldColors:               false

XTerm*boldMode:                 false

XTerm*colorBD:                  MediumBlue

XTerm*colorBDMode:              true
```

This will show Bold characters as colored MediumBlue.

same with attribute "underlined", changed them to be colored (green) ,too.

```
XTerm*underLine:                true

XTerm*colorUL:                  #1FA638

XTerm*colorULMode:              true
```

other colors ar available from: /usr/X11R6/lib/X11/rgb.txt

here an other thing, for those who use a scrollwheel:

the default behavior of the scrollwheel is to scroll a half page at once. This is for me quite unhandy.

If you like to change this also, put this in ~/.Xdefaults, taken from Vico's little Linux site and

Colas Nahaboo X mouse wheel scroll page:

( I´ve commented the default out )

```
!# Scrolling on wheel mouse: 4 Lines normally, half a page with shift

      XTerm.vt100.translations: #override\n\

!      <Btn4Down>,<Btn4Up>:scroll-back(1,line)\n\

!      <Btn5Down>,<Btn5Up>:scroll-forw(1,line)\n\

      Ctrl<Btn4Down>,<Btn4Up>:scroll-back(1,page)\n\

      Ctrl<Btn5Down>,<Btn5Up>:scroll-forw(1,page)\n\

Shift<Btn4Down>,<Btn4Up>:scroll-back(1,halfpage)\n\

Shift<Btn5Down>,<Btn5Up>:scroll-forw(1,halfpage)\n\

None<Btn4Down>,<Btn4Up>:scroll-one-line-down()scroll-one-line-down()scroll-one-line-down()scroll-one-line-down()scroll-one-line-down()\n\

None<Btn5Down>,<Btn5Up>:scroll-one-line-up()scroll-one-line-up()scroll-one-line-up()scroll-one-line-up()scroll-one-line-up()\n\      

!# In the scrollbar we map buttons 5 & 4 to 1 and 2 otherwise, core dump

!# This will move proportionnaly to cursor position but we dont know how to

!# program the same exact behavior as in the text widget.

      XTerm.vt100.Scrollbar.translations: #override\n\

      <Btn5Down>: StartScroll(Forward)\n\

      <Btn4Down>: StartScroll(Backward)\n\

```

and somebody else having problems with Meta (ALT-Key) not working in Xterm ??

Have look here at a tip from malloc :

I do recommend to put the following in /etc/inputrc, since it will make your life much easier.

taken from caliban.org :

```
# Adding this to your /etc/inputrc or ~/.inputrc will result in a character

# being appended to any file-names returned by completion, in much the same

# way as ls -F works.

set visible-stats on
```

```
# If you have this in your /etc/inputrc or ~/.inputrc, you will no longer

# have to hit the <Tab> key twice to produce a list of all possible completions.

# A single <Tab>  will suffice.

set show-all-if-ambiguous on
```

```
# alternate mappings for "page up" and "page down" to search the history

"\e[5~": history-search-backward

"\e[6~": history-search-forward
```

last but not least:

you all know this stupid thing, when emerging s.th. and there is a very important Info.

But before you can read it´s gone. Out of the window.

You can change this likewise, by putting this in ~/.Xdefaults,too.

( side note: when your interressted in this feature, you probably would like to have a look

at portlog-info,too.)

```
XTerm*scrollTtyOutput:      false

XTerm*scrollKey:            true

```

with this settings you can scroll back in Xterm and read it.

After that just press any button and you´re back in action.

and here a little fancy and other stuff from my .Xdefaults:

```
XTerm*highlightColor:           LightSkyBlue

XTerm*cursorColor:              MediumBlue

XTerm*pointerColor:             MediumBlue

XTerm*internalBorder:           3

XTerm*scrollBar:                true

XTerm*rightScrollBar:           true

XTerm*loginShell:               true

XTerm*geometry:                 85x23

XTerm*saveLines:                5000

XTerm*charClass:                33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48,35:48,58:48
```

Have also a look here:

The Non-Annoying Terminal Mini How-To & Fun with shopt

 :Arrow: _  screen

my ~/.screenrc is available

----------

## sobers_2002

 *Quote:*   

> only with this two options enabled you will increase the emerge time, since xterm scrolles much faster. 
> 
> try it 

 

increase emerge time or decrease????

----------

## Xk2c

stupid me

decrease of course. sorry

changed it

----------

## neonik

Very nice overview, I've found many interesting options here. Thank you.

But does it really matter how fast a terminal scrolls text?

----------

## Xk2c

 *neonik wrote:*   

> Very nice overview, I've found many interesting options here. Thank you.

 

So YOU are the one who read it. *lol* Glad you like it.  :Wink: 

 *neonik wrote:*   

> But does it really matter how fast a terminal scrolls text?

 

Once on the Mailinglist there was someone who has tested it.

He compared KDE Konsole with Xterm IIRC.

The time savings for him were about ~20% IIRC.

But only try emerge sync. With Xterm an -j, -s enabled you will notice immediately a difference.

At least it will definitely not hurt, just try it by yourself.

----------

## inode77

Jup some nice things here. I suggest you ask to move this one into DT&T.

Since you seem to know so much, I've got a problem and didn't find any soultion yet. I use aterm with bash and screen to multiplex it.

Now if I type a command that is longer than the wide of my window the line is not wrapped and I restart on the same line overwriting the beginning of my command. This is quite annoying and I wasn't able to find anything about it.

(Google linewrap aterm just brought some future plans for aterm to support automatic linewrapping in case of windowresizing)

Any hints would be greatly appriciated.

----------

## Xk2c

 *inode77 wrote:*   

> Jup some nice things here. I suggest you ask to move this one into DT&T.

 

How do I achieve this?

 *inode77 wrote:*   

> I use aterm with bash and screen to multiplex it. Now if I type a command that is longer than the wide 
> 
> of my window the line is not wrapped and I restart on the same line overwriting the 
> 
> beginning of my command.

 

Try adding this one to your ~/.bashrc    :Cool: 

```
shopt -s checkwinsize
```

This should do the trick   :Wink: 

----------

## inode77

 *Quote:*   

> How do I achieve this? 

 

Pm to pjb or someone else of the moderator crew.

EDIT: No luck so far with the linewrap thing.

```
shopt

cdable_vars     off

cdspell         off

checkhash       off

checkwinsize    on

....
```

aterm v0.4.2

bash version 2.05b.0(1)-release (i686-pc-linux-gnu)

screen version 4.00.02 (FAU) 5-Dec-03

Hmm.. and here my search for answers goes on.....

I even started a aterm without screen  and it still doesn't work.   :Sad: 

----------

## Xk2c

 *inode77 wrote:*   

> No luck so far with the linewrap thing.
> 
> shopt
> 
> cdable_vars     off
> ...

 

What kind of Syntax is that? Never saw this before.

Is not Bash, istn´t it?

hmmm

Here it works. I tried it just right now.

maybe only for testing put 

```
shopt -s checkwinsize
```

 to ~/.bashrc and see what happens?

from man bash:

```
checkwinsize

                      If  set,  bash  checks the window size after each command and, if neces-

                      sary, updates the values of LINES and COLUMNS.
```

OT:

I sent a message to ian!

----------

## inode77

 *Xk2c wrote:*   

> What kind of Syntax is that? Never saw this before.
> 
> Is not Bash, istn´t it? 

 

Thanks alot for your help so far.

It's no syntax it's just the output of command shopt.

But the good news is I've found the problem concerning linewrap, it is my $PS1! It seems there's something wrong with my prompt. Maybe you see what I wrote wrong.

```
export PS1="\u@\h:\W\`if [ \$? = 0 ]; then echo -e '\e[01;32m #'; else echo -e '\e[01;31m #'; fi\` \[\e[0m\]"
```

The prompt is nothing special but I like to have a colored symbol to give me feeback on retval $?.

If I switch to a simple prompt the problem goes away, but I really like to keep my prompt.  :Sad: 

----------

## Xk2c

 *inode77 wrote:*   

> Thanks alot for your help so far.
> 
> It's no syntax it's just the output of command shopt.

 

Thank you for the interesting posts.   :Very Happy: 

 *inode77 wrote:*   

> But the good news is I've found the problem concerning linewrap, it is my $PS1! It seems there's something wrong with my prompt. 
> 
> The prompt is nothing special but I like to have a colored symbol to give me feeback on retval $?.
> 
> If I switch to a simple prompt the problem goes away, but I really like to keep my prompt. 

 

your Prompt should it be like this?

nomal user = larry@Gentoo:larry #

root           = root@Gentoo:root #

Thanks for the tip with the shopt command. Didn´t know it before.   :Wink: 

----------

## inode77

 *Quote:*   

> your Prompt should it be like this?
> 
> nomal user = larry@Gentoo:larry #
> 
> root = root@Gentoo:root # 

 

My prompt looks and behaves like this:

(on $? not = 0 is turns red if 0 then green, best would be to have the "$" for user and the "#" automatically, @ moment that does my .bashrc by asking the value of $user)

user@machine:pwd $ ls

Desktop  art  bin  config  dev  downloads  movie  pen  sound  tele3  trash  various  vault  workspace

user@machine:pwd $ ls fud

ls: fud: No such file or directory

user@machine:pwd $

----------

## ian!

Moved to Documentation, Tips & Tricks.

----------

## Xk2c

ping inode77

Have not forgotten you, although my response time is a bit slow.    :Laughing: 

----------

## inode77

Echo reply (ICMP(0:0)) inode77 => Xk2c.

Today I finished my last examn at technical university so time for the moment (the next few days) does not matter at all.   :Wink: 

----------

## rex123

 *inode77 wrote:*   

> 
> 
> Maybe you see what I wrote wrong.
> 
> ```
> ...

 

You need to surround your colour change codes with \[...\]. This tells bash not to add any length for the intervening text. I hope this makes sense.

For example,

```

export PS1='\u@\h:\W\033[01;32m # \033[0m'

```

won't work properly, but 

```

export PS1='\u@\h:\W\[\033[01;32m\] # \[\033[0m\]'

```

will work OK.

----------

## inode77

Many thanks rex123!  :Very Happy: 

Works like a charm and linewrapping now too!

```
export PS1="\u@\h:\W`if [ $? = 0 ]; then echo -e '\[\e[01;32m\] #'; else echo -e '\[\e[01;31m\] #'; fi` \[\e[0m\]"
```

----------

## Xk2c

Cool rex123 thank you   :Wink: 

----------

## neenee

thanks for writing this guide  :Wink: 

----------

## Xk2c

You´re embarrassing me.  :Embarassed: 

glad you like it.   :Wink: 

----------

## cantao

Hi Friends!

Very nice howto! Thanks a lot!

But I still have a question concerning AA and xterm. When I use, for instance, Bitstream Vera fonts, the underscores (LIKE_THIS) don't get correctly scrolled, or even displayed sometimes. The lines move up, and the underscores keep frozen on the screen... Any ideas?

Thanks in advance, Cantão!

----------

## Xk2c

 *cantao wrote:*   

> 
> 
> Very nice howto! Thanks a lot!

 

Your are welcome (to Gentoo)   :Very Happy:   :Wink: 

 *cantao wrote:*   

> But I still have a question concerning AA and xterm. When I use, for instance, Bitstream Vera fonts, the underscores (LIKE_THIS) don't get correctly scrolled, or even displayed sometimes. The lines move up, and the underscores keep frozen on the screen... Any ideas?
> 
> 

 

This must be some kind of a bug but I do not know what it causes. Sorry.

I´ve tried it here and I do not have any problems with that.

Maybe open up an other thread to ask for help, or fill in a bug on https://bugs.gentoo.org/

----------

## viy

Yes! Really useful!

 *Xk2c wrote:*   

> 
> 
> _  screen
> 
> screeni 1
> ...

 

Is it possible to take a glance at your screenrc?

I'm using uxterm and cannot get that status line at the bottom. "info", "windows" --- all is shown (for a while) as terminal window's title...

----------

## Xk2c

 *viy wrote:*   

> Is it possible to take a glance at your screenrc?

 

....of course. You are welcome.

In fact it was my intention to add a paragraph about screen to this Tip 'n Trick   :Wink: 

buuut hmm .... guess I´m lazy ;P

here we go.   Have Fun.

PS.  If you find some featuers to improve it, than please let me know.  OK?

PPS. The line your are looking for is caption always

         Just try the differnt Versions of caption always to the one that fits your needs.

```
#shell -bash

shell -$SHELL

shelltitle '$ |bash'

bufferfile $HOME/.screen_exchange

hardcopydir $HOME/.screen

term xterm

vbell off

multiuser off

#attrcolor i "+b"

#attrcolor b "-b"

deflogin

termcapinfo xterm* OL=25000

defscrollback 25000

# Prepend/append register [/] to the paste if ^a^] is pressed.

# This lets me have autoindent modes in vi(m).

register [ "\033:se paste\015a"

register ] "\033:se nopaste\015a"

bind ^] paste [.]

hardstatus off

backtick 1 1200 1200 whoami

caption always "%3n %t%? @%u%?%? [%h]%?%=%c:%s"

#caption always "%{=b wk} %D %d.%m %c  | %-w%{=br}%n %t%{-}%+w "

#caption always "%{=b}%?%F%:%45=%n*%f %t%?%?%F%{r}%:%{s kk}%?%H%?%F%{-}%? %L=%-Lw%45L>%?%F%{g}%?%n*%f %t%?%F%{-}%?%+Lw%-17= %?%F%{y}%?%c %d.%m.%Y%?"

# Kein Splashscreen, bitte

startup_message off

# Make the F12 (not F2!) key an alternative screen escape

# (besides ^A).

bindkey -k F2 command

# xterm scrollbar should work with screen

# also for scroll wheel

termcapinfo xterm ti@:te@

termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'

termcapinfo rxvt 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'

# Enter copy mode (PgUp/PgDn to move)

# INSERT alternativly ALT+PgUp

bindkey -k kI copy

bindkey ^[[5;3~ copy

# Paste copy buffer

# ALT-INSERT

bindkey "^[^[[2~" paste .

# Change to left/right window in relation to current window

# (wraps on edges) ALT-,.

bindkey "^[," prev

bindkey "^[." next

# For root users, you may want to add the following instead of the above.

# Essentially this allows me root account to be using screen easily nested

# within my regular user's screen session.

# ALT-;'

# bindkey "^[;" prev

# bindkey "^[:'" next

# Shift current window left/right in relation to current window

# (!broken, attempting to fix)

# ALT-<> (for those that have trouble understanding ALT-SHIFT-,.)

bindkey "^[<" eval number !echo $WINDOW-1|bc

bindkey "^[>" eval number !echo $WINDOW+1|bc

# select an open window direct with ALT+ 0-9

bindkey "^[1" select 0

bindkey "^[2" select 1

bindkey "^[3" select 2

bindkey "^[4" select 3

bindkey "^[5" select 4

bindkey "^[6" select 5

bindkey "^[7" select 6

bindkey "^[8" select 7

bindkey "^[9" select 8

bindkey "^[0" select 9

# automatically started Programs

screen -t root        0 su -

screen 1

screen 2

# remap w to the selectable list

bind w windowlist -b

bind W windows

# Drei Sessions starten und im geteilten Fenster anzeigen

#screen -t foo 1 top

#screen -t bar 2 watch -n1 date

#screen -t baz 3 tail -f /var/log/httpd/access_log

# Erste Session anzeigen

#select foo

# Splitten in zwei Regionen

#split

# In zweite Region wechseln

#focus down

# Zweite Session anzeigen

#select bar

# Diese Region wieder splitten

#split

# In dritte Region wechseln

#focus down

# Dritte Session anzeigen

#select baz

#############################################################

# EXPLANATION OF ABOVE STATUS LINE

###

# cat > /dev/null

# Funktion keys F1-F9   k0-k9

# Funktion key  F10     k

# Funktion keys F11-F12 F1-F2

# Funktion keys F13-F63 F3-F9,FA-FZ,Fa-Fr

# caption -- Provides a status line for each split.

# always -- "always" gives a status line in non split mode.

# %{=b} -- make it bright so that I have a clear list of items

# %?%F%:%45=%n*%f %t%? -- If current window does not have focus

# -- (this is a split) so we move to 45% of the screen and put,

# -- this split's selected window's title and flags.

# From here on is a hack until a "%-F" for no focus is provided.

# essentially, you can only select non-focused windows with "%?%F%:non-focused code%?"

# What is being added in the future will allow windows with "%?%-F%:focused code%?"

# If this doesn't make sense, don't worry, but it has to be done that way with variable

# expansion rules as they are.

# %?%F%{r}%:%{s kk}%? -- If current window has focus, make text red, else (%:)

# -- make the text standout (normal colors) and black on black.

# -- net effect by this is that the focused window shows my status bar

# -- unfocused windows show only their selected window's title.

# %H -- Provide the hostname,

# %?%F%{-}%? -- If this window has focus, pop off the last color on the color stack (i.e. red)

# %L= -- Set truncation marker to this location, permits the spiffy elipses

# %-Lw -- Provide the window list before the current window

# %45> -- Not really sure, but I think it sets the current window to the 45% mark

# %?%F%{g} -- If current window has focus, set color green, unfocused windows have standout with black on black (color stack)

# %?%n*%f %t -- Window number * flags title

# %?%F%{-}%? -- If this window has focus, pop off the last color on the color stack (i.e. green)

# %+Lw -- Provide the window list following the current window

# %-17= -- Go 17 characters from the right of screen towards left

# %?%F%{y} -- If current window has focus, set color yellow, unfocused windows have standout with black on black (color stack)

# %?%c %Y-%m-%d%? -- Provide time and date in HH:MM YYYY-MM-DD, which is 16 characters, plus one so that truncation from the

# window list will be truncated with a space between the date and window list
```

----------

## markandrew

i can't get scrolling to work as i want in screen - basically, i'd like to be able to scroll with my mouse and pgup/pgdn keys without having to enter copy mode. is this possible?

i tried the lines from your screenrc but they didn't work. however, one strange thing - ONE terminal with screen running lets me scroll with my mouse without any adjustments to .screenrc. all other terminals don't. i can stop/restart the terminal and it still works. any other terminals i start don't allow scrolling. very, very strange

----------

## Xk2c

 *markandrew wrote:*   

> i can't get scrolling to work as i want in screen - basically, i'd like to be able to scroll with my mouse and pgup/pgdn keys without having to enter copy mode. is this possible?
> 
> i tried the lines from your screenrc but they didn't work. however, one strange thing - ONE terminal with screen running lets me scroll with my mouse without any adjustments to .screenrc. all other terminals don't. i can stop/restart the terminal and it still works. any other terminals i start don't allow scrolling. very, very strange

 

You are looking for:

```
# xterm scrollbar should work with screen

# also for scroll wheel

termcapinfo xterm ti@:te@

termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'

termcapinfo rxvt 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
```

This should work with xterm, aterm, and rxvt (rxvt-unicode),too.

But beaware that you scroll back in TERM History with that, not in screens history!!

This means also you have to enable a Xterm history

e.g. 

```
xterm -sl 5000
```

Which means, if you have several Screen-Session opened each of them will overide this TERM history.

But the screen history is available for every session allways!

Try it. 

This "dirty hack" works good enough for me.

If someone has a better idea please let me know.

----------

## markandrew

i tried that, it didn't work. here is my .screenrc:

```

defscrollback 5000

shell /bin/bash

# set window title to current command

shelltitle '$ |bash'

# extra key binds

bindkey -k F9 prev

bindkey -k FA next

#<F9> and <F11> binds                                                           #bindkey -k k9 prev

#bindkey -k F1 next                                                             

bindkey -k k1 select 1

bindkey -k k2 select 2

bindkey -k k3 select 3

bindkey -k k4 select 4                                                          bindkey -k k5 select 5

bindkey -k k6 select 6                                                          

# show host, time/date, and window list

#hardstatus alwayslastline "%{rk}%H%{wk} %c %M%d  %?%-Lw%?%{gk}%n-%f %t%?(%u)%?%{wk}%+Lw%? "

hardstatus alwayslastline "%{rk}%H%{wk} %c %d-%M  %?%-Lw%?%{gk}%n-%f %t%?(%u)%?%{wk}%+Lw%? "

autodetach off

startup_message off

# xterm scrollbar should work with screen

# also for scroll wheel

term rxvt

termcapinfo xterm ti@:te@

termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'

termcapinfo rxvt 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'

```

i'm using screen with aterm, which is based on rxvt; do i need to alter anything (like the termcapinfo xterm ti@:te@ line) to get it working?

----------

## Xk2c

 *markandrew wrote:*   

> i tried that, it didn't work. here is my .screenrc:
> 
> <snip>
> 
> i'm using screen with aterm, which is based on rxvt; do i need to alter anything (like the termcapinfo xterm ti@:te@ line) to get it working?

 

Sorry you are right.

This scrollback feature does not work with aterm and urxvt anymore.

Problably s.th. has change in termcapinfo (/etc/terminfo/) for all rxvt based TERMs.

I´m using Xterm all time. With Xterm it still works like I said.

hmmm

Maybe some Term Hacker know what to change to make it work again????

----------

## markandrew

doh!  :Smile: 

where could i find out how to make it work? is there somewhere i can find it, or is it quite involved?

----------

## Xk2c

 *markandrew wrote:*   

> doh! 
> 
> where could i find out how to make it work? is there somewhere i can find it, or is it quite involved?

 

Yes it is involved !!! 

I found this feature on the iNet.

Maybe have a look around at google and Mailinglist archives.

http://www.gnu.org/software/screen/screen.html

http://lists.gnu.org/archive/html/screen-users/

...this is a start from.

....and do not forget to post your answer, when you find it.

It´s out there. I know it.    :Very Happy:   :Cool: 

Where no one else has gone before.......  ;PPP

good luck

----------

## markandrew

i already looked there :/

but i didn't know it was termcapinfo related, so i'll have a looksie. thanks

----------

## markandrew

ok, this is really annoying. i changed TERM=rxvt to TERM=xterm in .screenrc, and bingo. two of my 3 open terminals starting scrolling in screen, with mouse wheel and shift-pgup/dn

the 3rd terminal does not work like this.

wtf? 

why do some work and others not!? how is that reasonable? just enough carrot to make me think i've got it working, then a big fat stick-whack  :Sad: 

EDIT: i just added

```

termcapinfo rxvt ti@:te@

```

to .screenrc and, um... it works! that was easy...  :Smile: 

----------

## Xk2c

 *markandrew wrote:*   

> why do some work and others not!? how is that reasonable? 

 

```
echo $TERM
```

from the man:

```
 -tn termname

This  option  specifies  the name of the terminal type to be set in the TERM environment variable. This terminal type must exist in the termcap(5)  database  and should have li# and co# entries; resource termName.
```

----------

## markandrew

$TERM was set to the same value ('rxvt') in all terminals - that's what i couldn't understand.

anyway, it's working now, so no matter. thanks anyway

----------

## Loki|muh

I have a problem with XTerm*charClass:

I have it like this:

XTerm*charClass: 33:48,35:48,37:48,43:48,45-47:48,61:48,63:48,64:48,95:48,126:48,35:48,58:48

but it does not mark URLs with a & in it  :Sad:  It always stops at the &  :Sad: 

I use xterm.

any ideas?

----------

## truekaiser

just a slight note if your .Xdefaults file doesn't get loaded you can always put the command givin earlyer

```
xrdb -load ~/.Xdefaults
```

into the .bashrc file.

----------

## BudgetDedicated

I like to see the exit code of a script explicitly, e.g. that a kernel compile went OK.

In your /etc/profile, change: 

```
#This:

export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'

#To this:

                export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W $? \$ \[\033[00m\]'

Example:

```

The difference is just a simple $?

You can also do echo $? after a command.

```
-bash: not_here: command not found

thisServer root 127 #

```

----------

## lovecraft

Hey all,

You might not know about this handy command.  Do an "emerge xtermcontrol" and you can do all kinds of crazy stuff to your xterm *on the fly* - like changing bg/fg colors, fonts, title string, iconifying/deciconifying....  Long list!

Have fun,

----------

## wickwire

I'm sorry if I missed it somewhere but I've searched a lot and came out empty-handed on this one:

I'm running urxvt. I list a folder. Mouse scroll works just fine, scroll buffer as well. I then run screen. I move into another folder, list, scroll - and the scroll shown is from the initial folder I did prior to starting screen. All folders afterwards, same result.

I'm running urxvt. Don't list. I start screen. List, no scroll.

It seems that inside screen, the buffer won't update from what it had prior to running screen...  :Question: 

I'm not sure what I'm supposed to have on ~/.screenrc, contents follow:

grin@GRiN ~ $ l .screenrc 

-rwxr-xr-x  1 grin 60 Mai 27 01:09 .screenrc*

```
 defscrollback 5000

shell /bin/bash

termcapinfo rxvt ti@:te@
```

What am I missing...?

Thanks for the help!

----------

## Xk2c

have a look here:

https://forums.gentoo.org/viewtopic-p-1886767.html#1886767

basically there are 2 !! Histories.

one from your Term and another from screen. 

if you scroll with your mousewheel you scroll ONLY through the Term history!!

same with Shift+PgUp.

Screen's history is only available through: Strg+A  ESC

The thing is, when you work in screen it OVERWRITES the history from your Term.

This way we can use the scrollwheel in screen.

But if you need to know what happend some time back you have to enter the screen history.

----------

## wickwire

Thanks for the reply! I enabled both histories like you said and then I got to scroll with buffer inside screen, but only about 30 lines would stay in buffer - having set 5000 - so then I found and "remarked" line on my .Xdefault, using #, took it out and from then on it's working! Thanks a lot for your tips!  :Very Happy: 

Here are my configs just in case:

.Xdefaults

```
grin@GRiN ~ $ cat .Xdefaults

URxvt*background:       black

URxvt*foreground:       white

URxvt*scrollBar:        false

URxvt*loginShell:       true

URxvt*inheritPixmap:    true

URxvt*tintColor:        #1a506d

URxvt*shading:          75

URxvt*title:            Gentoo Terminal

URxvt*name:             urxvt

URxvt*saveLines: 5000

URxvt*iconName:         Terminal

URxvt*font:    xft:arial:pixelsize=13:charwidth=10

URxvt*geometry:         101x19+0+0

URxvt*termName:         rxvt-unicode

URxvt*scrollTtyKeypress:true

URxvt*scrollWithBuffer: true

URxvt*borderLess:       true

URxvt*scrollTtyOutput:  true

URxvt*scrollKeypress:   false

```

```
.screenrc

grin@GRiN ~ $ cat .screenrc 

defscrollback 5000

shell /bin/bash

term rxvt-unicode

URxvt -sl 5000

# xterm scrollbar should work with screen 

# also for scroll wheel 

termcapinfo rxvt-unicode ti@:te@ 

termcapinfo rxvt-unicode 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'

```

----------

