Feature Request: Move single column to the left & right
muhmud opened this issue · 10 comments
It would be great to be able to move a single column to the left and right.
I would propose using Ctrl + h / KEY_LEFT
and Ctrl + l / KEY_RIGHT
for these movements.
I think maybe I didn't state this clearly: I mean it should move one terminal character to the left & right, regardless of how columns are drawn.
Sure, can do, however, if you look at the man page for less
, it's basically the same functionality as the [-# shift]
option with a value of 1
, but only applied when the Ctrl
key is used.
What I would like is to keep the existing functionality of h
and l
as it is, but if Ctrl h
or Ctrl l
is used, then only move by a single column position.
If it still doesn't make sense, please let me know & I'll do an ASCII diagram
Take a look at the attached file from sqlcmd (MSSQL Server) for an example of where I'm having issues. The last column TABLE_TYPE
can be difficult to catch, though it seems better in less
.
It would also be great if pspg could somehow clean up the output to remove the wasted space, though I suspect this might be difficult...
I implemented one char horizontal scrolling controlled by ^left and ^right. I cannot to use ^h and ^l, because ^l is used for different purpose already. See commit 945d783
Unfortunately pspg cannot to reformat original document. It is just pager. If your client can print data in csv format, then pspg can read data in csv format and can do internal formatting to table. It was used as workaround for older slow table formatting in pgcli (already fixed), or it is used for sqlite.
Thanks @okbob , just tried it out & it works great, though only in xterm. I normally use st
and none of the Ctrl
-based shortcuts work for me. I'll have to try and sit down with it to figure out why, as the reported escape codes are the same in both.
I worked around the formatting issue by preprocessing the output in perl before passing it to pspg
, and making it look like it came from postgres, which works pretty well. I didn't know about the CSV functionality, that's pretty useful, thanks for that 👍
Maybe terminfo for st terminal is not good, or maybe your TERM specification has some issue.
Unfortunately - escape sequences and related codes can be different - pspg uses ncurses terminfo database, and when the configuration of TERM is not correct, or data in terminfo database is not current, then it can be broken.
Yep, I think it's something like that; we can close this issue now if you like
ok :)