You are not logged in.

#1 2011-09-06 18:09:30

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

urxvt: resizing terminal cuts off lines

I report a bug of urxvt found in the web and that i cannot resolve, i hope that here there is someone who can help me:

I'm using rxvt-unicode's "urxvtc" as X11 terminal.

If I resize the terminal window before text output has already filled a screenful and the terminal has scrolled down a few lines, the text lines already in the window are cut to fit the resized window.

When there has been enough output (so that the scrollbar is not 100% full), then the terminal does the right thing: lines longer than the new terminal width are wrapped around, and no screen content is lost.

I'm using a tiling window manager, so terminal resize happens automatically all the time, and it gets annoying to lose part of the text.

Do you have any solutions? Thanks

Last edited by TheImmortalPhoenix (2011-09-06 18:10:20)

Offline

#2 2011-09-07 06:28:51

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: urxvt: resizing terminal cuts off lines

A quick and dirty hack:

--- rxvt-unicode-9.12-orig/src/screen.C	2011-09-07 08:20:00.000000000 +0200
+++ rxvt-unicode-9.12/src/screen.C	2011-09-07 08:21:15.000000000 +0200
@@ -283,7 +283,7 @@ rxvt_term::scr_reset ()
       int pend = MOD (term_start + top_row  , prev_total_rows);
       int q    = total_rows; // rewrapped row
 
-      if (top_row)
+      if (1)
         {
           // Re-wrap lines. This is rather ugly, possibly because I am too dumb
           // to come up with a lean and mean algorithm.

You might want to add a "clear" statement to the end of your shell rc file(s) after applying this patch.

Offline

#3 2011-09-07 07:19:08

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: urxvt: resizing terminal cuts off lines

Sorry but i don't understand...what i should do exactly?

Offline

#4 2011-09-07 07:26:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: urxvt: resizing terminal cuts off lines

TheImmortalPhoenix wrote:

Sorry but i don't understand...what i should do exactly?

ber_t is suggesting you hack urxvt. You need to change the line saying

if (top_row)

in rxvt-unicode-9.12/src/screen.C to

if (1)

and recompile.

Offline

#5 2011-09-07 07:45:31

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: urxvt: resizing terminal cuts off lines

Ah ok so i download rxvt-unicode PKGBUILD with abs, compile it and and edit file in ./src and than recompile PKGBUILD and then installt tha package?

Offline

#6 2011-09-07 08:06:38

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: urxvt: resizing terminal cuts off lines

in screen.C and can't fine that line...

EDIT: i found it...but i have to change only that line either i have to replace each "top_row" with "1"?

EDIT 2: It didn't work...it's worst than before....i tell you what i've done:

First of all i removed rxvt-unicode and installed xterm; then i downloaded the list of PKGBUILD with abs, i took /extra/rxvt-unicode and copied it in my home...i opened it in terminal and digited "makepkg PKGBUILD"...so it created the packages and the folder /pkg and /src...i went in /src/rxvt-unicode-9.12/src/ folder and edited file screen.C, changing "if (top_row)" to "if (1)"...i saved and went to /src/rxvt-unicode-9.12/ folder, opened terminal and compiled with configure-make-sudo make installed.....but my urxvt still cut lines, and also the text!!...i mean that before sometimes the text was pasted to the next line, but now it's cutted completely....

Last edited by TheImmortalPhoenix (2011-09-07 08:22:06)

Offline

#7 2011-09-07 08:55:23

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: urxvt: resizing terminal cuts off lines

Get rxvt-unicode from abs.
Replace the PKGBUILD with the following:

# $Id: PKGBUILD 129923 2011-06-29 23:05:47Z stephane $
# Maintainer: Angel Velasquez <angvp@archlinux.org> 
# Contributor: tobias <tobias@archlinux.org>
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org

pkgname=rxvt-unicode
pkgver=9.12
pkgrel=1
pkgdesc="An unicode enabled rxvt-clone terminal emulator (urxvt)"
arch=('i686' 'x86_64')
url="http://software.schmorp.de/pkg/rxvt-unicode.html"
license=('GPL')
depends=('gcc-libs' 'libxft' 'gdk-pixbuf2')
optdepends=('perl: lots of utilities' 'gtk2-perl: to use the urxvt-tabbed')
changelog=ChangeLog
source=(http://dist.schmorp.de/rxvt-unicode/${pkgname}-${pkgver}.tar.bz2 \
        ${pkgname}.desktop
        rxvt-unicode-9.12-always_rewrap.diff)
md5sums=('945af37d661c8c45a7cac292160e7c70'
         '3de6c13126a45bc3bc9f6bba077a1311'
         'cce1fc7bb95c4652efc45029834ed48d')
sha1sums=('4cbf0516b8304dfb041b9f3e5aaba662fee4b979'
          '962aebc88982dbeb62a7c4a051ff567e015f61a0'
          '93e7eb729897cfd35acb941602560c1216dcb0c5')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -up 1 -i "${srcdir}/rxvt-unicode-9.12-always_rewrap.diff"
  ./configure --prefix=/usr \
    --with-terminfo=/usr/share/terminfo \
    --enable-256-color \
    --enable-font-styles \
    --enable-xim \
    --enable-keepscrolling \
    --enable-selectionscrolling \
    --enable-smart-resize \
    --enable-pixbuf \
    --enable-transparency \
    --enable-utmp \
    --enable-wtmp \
    --enable-lastlog \
    --disable-frills
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  install -d "${pkgdir}/usr/share/terminfo"
  export TERMINFO="${pkgdir}/usr/share/terminfo"
  make DESTDIR="${pkgdir}" install
 # install the tabbing wrapper ( requires gtk2-perl! )
  sed -i 's/\"rxvt\"/"urxvt"/' doc/rxvt-tabbed
  install -Dm 755 doc/rxvt-tabbed "${pkgdir}/usr/bin/urxvt-tabbed"
 # install freedesktop menu
  install -Dm644 ../${pkgname}.desktop \
    "${pkgdir}/usr/share/applications/${pkgname}.desktop"
}

Save the the patch from my first post as "rxvt-unicode-9.12-always_rewrap.diff" in the same directory. Run makepkg inside the directory and install the new pkg with pacman.

Offline

#8 2011-09-07 09:26:20

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: urxvt: resizing terminal cuts off lines

All like before sad

If there is no solution do you know other terminals with 256-color support and with the same proprierties of urxvt?

Last edited by TheImmortalPhoenix (2011-09-07 09:31:04)

Offline

#9 2011-09-10 06:08:10

vitoreiji
Member
Registered: 2009-09-04
Posts: 67

Re: urxvt: resizing terminal cuts off lines

TheImmortalPhoenix wrote:

All like before sad

Strange, it worked for me...
Did you copy the patch to the src dir before building? Did you 'pacman -U'ed the resulting package?

Offline

#10 2011-09-10 12:35:29

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: urxvt: resizing terminal cuts off lines

i've done all that ber_t wrote

Offline

#11 2012-12-01 07:39:39

gouthamvel
Member
Registered: 2012-08-25
Posts: 2

Re: urxvt: resizing terminal cuts off lines

One solution is to run your commands within screen. Screen wraps lines while resizing, but in this case, running a shell inside a terminal multiplexer may seem a little unaesthetic.

The second solution is to use the following code in your .bashrc:

for (( i=1; i<=$LINES; i++ )); do echo; done; clear

If $LINES is undefined, then set LINES=$(tput lines).


source http://superuser.com/questions/442589/x … r-resizing

Offline

Board footer

Powered by FluxBB