Thread: terminal with horizontal scrollbar
When using select in psql for tables with a lot of columns, I often get rows which wrap at the right side of the screen to the next row, this makes the columns into a mess. It would be nice to have a terminal (something like rxvt or xterm) which allows horizontal scrolling. Does anyone know of such a terminal program? best regards, Hugo p.s. I'm not interested in using pgaccess as a workaround for this, I just want to use plain psql It's also not a solution for me to use a smaller font
Can't help with the terminal app, but there's an option in psql to have it print out the results verticly (one field per line)... doesn't work real well if lots of rows get returned, but for one or two it's nice. On Mon, 25 Feb 2002, Hugo Coolens wrote: > When using select in psql for tables with a lot of columns, I often get > rows which wrap at the right side of the screen to the next row, this > makes the columns into a mess. It would be nice to have a terminal > (something like rxvt or xterm) which allows horizontal scrolling. Does > anyone know of such a terminal program? > > best regards, > Hugo > p.s. I'm not interested in using pgaccess as a workaround for this, I > just want to use plain psql > It's also not a solution for me to use a smaller font > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >
On Mon, Feb 25, 2002 at 10:05:38AM +0100, Hugo Coolens wrote: > When using select in psql for tables with a lot of columns, I often get > rows which wrap at the right side of the screen to the next row, this > makes the columns into a mess. It would be nice to have a terminal > (something like rxvt or xterm) which allows horizontal scrolling. Does > anyone know of such a terminal program? I use PAGER=less When psql has piped the output to less, by default the text wraps. However, if you type -S, less will unwrap the lines for you. -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > If the company that invents a cure for AIDS is expected to make their > money back in 17 years, why can't we ask the same of the company that > markets big-titted lip-syncing chicks and goddamn cartoon mice?
On Tue, Feb 26, 2002 at 10:07:25AM -0800, Philip Hallstrom wrote: > Can't help with the terminal app, but there's an option in psql to have it > print out the results verticly (one field per line)... doesn't work real > well if lots of rows get returned, but for one or two it's nice. Yes, using \x will give you each record on multiple lines (one attribute per line). When viewing a large table, you might want to (ab)use some options on your pager. Specifically: export PAGER="/usr/bin/less -S" Note this will only work if psql calls the pager, and it only does so if the number of lines will be greater than the height of your xterm. There might be a way to tell psql to unconditionnaly pipe through PAGER, but then, even in simple queries, you would have to hit 'q' to get back to psql's prompt... I haven't yet looked in psql's source to see where that lines number check gets done, but I'm sure one could change that check to use an option rather than the actual number of lines. Just my 2 cents (CDN)... Antoine > On Mon, 25 Feb 2002, Hugo Coolens wrote: > > > When using select in psql for tables with a lot of columns, I often get > > rows which wrap at the right side of the screen to the next row, this > > makes the columns into a mess. It would be nice to have a terminal > > (something like rxvt or xterm) which allows horizontal scrolling. Does > > anyone know of such a terminal program? > > > > best regards, > > Hugo > > p.s. I'm not interested in using pgaccess as a workaround for this, I > > just want to use plain psql > > It's also not a solution for me to use a smaller font -- | Antoine Reid, SysAdmin, NetAdmin | |---------------------------------------------------------------------------| | Magnetism, electricity and motion are like a three for-two special offer: | | If you have two of them, the third one comes free. |
On Tue, Feb 26, 2002 at 05:45:23PM -0500, Antoine Reid wrote: > Note this will only work if psql calls the pager, and it only does so if the > number of lines will be greater than the height of your xterm. There might > be a way to tell psql to unconditionnaly pipe through PAGER, but then, even > in simple queries, you would have to hit 'q' to get back to psql's prompt... Couldn't ou pass less the '-e' switch as well? Then you wouldn't have to hit 'q' everytime. (Of course, I guess you'd lose the output at the end of a long result set.) A -- ---- Andrew Sullivan 87 Mowat Avenue Liberty RMS Toronto, Ontario Canada <andrew@libertyrms.info> M6K 3E3 +1 416 646 3304 x110
Hugo Coolens wrote: > > When using select in psql for tables with a lot of columns, I often get > rows which wrap at the right side of the screen to the next row, this > makes the columns into a mess. Some people have suggested me two solutions 1. in psql give the command \x 2. before starting psql give the command: export "PAGER=less -S" thanks to all who suggested this hugo
Hugo Coolens <hugo.coolens@skynet.be> writes: > When using select in psql for tables with a lot of columns, I often get > rows which wrap at the right side of the screen to the next row, this > makes the columns into a mess. It would be nice to have a terminal > (something like rxvt or xterm) which allows horizontal scrolling. Does > anyone know of such a terminal program? use less instead of more and in your envirmoent set the variable LESS to "-S", see less(1). Regards, Manuel.