Closed eribertomota closed 4 years ago
Works for me with hexedit 1.4.2-3
Em seg, 1 de out de 2018 às 04:31, Pascal Rigaux notifications@github.com escreveu:
Works for me with hexedit 1.4.2-3
Thanks for your reply. I installed a VM running Buster and I got the same results.
Could you diagnose? Which terminal?
I think I found the problem. hexedit fails over some terminal types. In my system it fails inside a jail made with debootstrap command and over ssh operations.
Thanks in advanced.
Cheers,
Eriberto
Em qua, 3 de out de 2018 às 06:27, Pascal Rigaux notifications@github.com escreveu:
Could you diagnose? Which terminal?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pixel/hexedit/issues/31#issuecomment-426569980, or mute the thread https://github.com/notifications/unsubscribe-auth/AGIyrlsqw7MUx96VE0JwmV4ljvs9Y6RKks5uhILsgaJpZM4XBGPR .
Taking advantage of these messages, can you implement a -v option to show version? I intent to use it for CI test in Debian (a trivial test only, to see automatically if the command runs after each build in Debian).
Thanks.
Works for me with xterm which sets TERM=xterm.
hexedit refuses to start with rxvt-unicode which sets TERM=rxvt-256color with TERM=rxvt it works.
For CI test, you could do hexedit -h 2>&1 | grep -q '^usage'
?
Works for me with xterm which sets TERM=xterm.
hexedit refuses to start with rxvt-unicode which sets TERM=rxvt-256color with TERM=rxvt it works.
Hum... Works for me with TERM=linux too. Isn't it a bug in hexedit? Note that a ssh connection will not set a special term and hexedit will show the first line wrong. Other programs work fine.
For CI test, you could do
hexedit -h 2>&1 | grep -q '^usage'
?
Seems correct. I will try it.
Thanks!
Eriberto
I have the same problem, first line is broken! Setting TERM does not change anything.
It looks like a broken terminal. Once again I need more info to diagnose!
what do you need for diagnosis? I can confirm, setting TERM=linux hexedit SOURCES/hexedit-1.4.2.tar.gz works. With TERM=xterm it does not.
Which terminal are you using? No issue with
tput cols
in case the bug is terminal size dependent.I'm using Mageia 6 with LXDE Desktop
nope, the output does not depend on the size of the terminal. Just the first row, the hex adress 0 is just printed as 0 not as "00000000". I'm confused this depends on the terminal set.
Using TERM=xterm or TERM=linux, is not possible save or use F1.
I can reproduce it over here using Ubuntu 19.04. My ssh session reports:
$ echo $TERM
xterm-256color
And editing the output of date gives ($ date > d):
$ hexedit d
0 57 65 64 20 41 70 72 20 20 31 20 30 38 3A 31 32 3A 35 31 20 43 45 53 54 20 32 30 32 30 0A Wed Apr 1 08:12:51 CEST 2020.
0000002C
I would expect something like:
00000000 57 65 64 20 41 70 72 20 20 31 20 30 38 3A 31 34 3A 35 34 20 43 45 53 54 20 32 30 32 30 0A Wed Apr 1 08:14:54 CEST 2020.
0000002C
Here is the output of:
$ TERM=xterm-256color hexedit d $ TERM=xterm-16color hexedit d $ TERM=xterm hexedit d
they all give:
0 57 65 64 20 41 70 72 20 20 31 20 30 38 3A 31 32 3A 35 31 20 43 45 53 54 20 32 30 32 30 0A Wed Apr 1 08:12:51 CEST 2020.
0000002C
while
$ TERM=xterm-color hexedit d
gives:
00000000 57 65 64 20 41 70 72 20 20 31 20 30 38 3A 31 32 3A 35 31 20 43 45 53 54 20 32 30 32 30 0A Wed Apr 1 08:12:51 CEST 2020.
0000002C
And for reference:
$ infocmp xterm xterm-color
comparing xterm to xterm-color.
comparing booleans.
bce: T:F.
mc5i: T:F.
npc: T:F.
comparing numbers.
comparing strings.
blink: '\E[5m', NULL.
cbt: '\E[Z', NULL.
civis: '\E[?25l', NULL.
cnorm: '\E[?12l\E[?25h', NULL.
cvvis: '\E[?12;25h', NULL.
dim: '\E[2m', NULL.
ech: '\E[%p1%dX', NULL.
el1: '\E[1K', NULL.
enacs: NULL, '\E)0'.
flash: '\E[?5h$<100/>\E[?5l', NULL.
hpa: '\E[%i%p1%dG', NULL.
ich: '\E[%p1%d@', NULL.
indn: '\E[%p1%dS', NULL.
invis: '\E[8m', NULL.
is2: '\E[!p\E[?3;4l\E[4l\E>', '\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8'.
kDC: '\E[3;2~', NULL.
kEND: '\E[1;2F', NULL.
kHOM: '\E[1;2H', NULL.
kIC: '\E[2;2~', NULL.
kLFT: '\E[1;2D', NULL.
kNXT: '\E[6;2~', NULL.
kPRV: '\E[5;2~', NULL.
kRIT: '\E[1;2C', NULL.
kb2: '\EOE', NULL.
kcbt: '\E[Z', NULL.
kend: '\EOF', NULL.
kent: '\EOM', NULL.
kf1: '\EOP', '\E[11~'.
kf13: '\E[1;2P', '\E[25~'.
kf14: '\E[1;2Q', '\E[26~'.
kf15: '\E[1;2R', '\E[28~'.
kf16: '\E[1;2S', '\E[29~'.
kf17: '\E[15;2~', '\E[31~'.
kf18: '\E[17;2~', '\E[32~'.
kf19: '\E[18;2~', '\E[33~'.
kf2: '\EOQ', '\E[12~'.
kf20: '\E[19;2~', '\E[34~'.
kf21: '\E[20;2~', NULL.
kf22: '\E[21;2~', NULL.
kf23: '\E[23;2~', NULL.
kf24: '\E[24;2~', NULL.
kf25: '\E[1;5P', NULL.
kf26: '\E[1;5Q', NULL.
kf27: '\E[1;5R', NULL.
kf28: '\E[1;5S', NULL.
kf29: '\E[15;5~', NULL.
kf3: '\EOR', '\E[13~'.
kf30: '\E[17;5~', NULL.
kf31: '\E[18;5~', NULL.
kf32: '\E[19;5~', NULL.
kf33: '\E[20;5~', NULL.
kf34: '\E[21;5~', NULL.
kf35: '\E[23;5~', NULL.
kf36: '\E[24;5~', NULL.
kf37: '\E[1;6P', NULL.
kf38: '\E[1;6Q', NULL.
kf39: '\E[1;6R', NULL.
kf4: '\EOS', '\E[14~'.
kf40: '\E[1;6S', NULL.
kf41: '\E[15;6~', NULL.
kf42: '\E[17;6~', NULL.
kf43: '\E[18;6~', NULL.
kf44: '\E[19;6~', NULL.
kf45: '\E[20;6~', NULL.
kf46: '\E[21;6~', NULL.
kf47: '\E[23;6~', NULL.
kf48: '\E[24;6~', NULL.
kf49: '\E[1;3P', NULL.
kf50: '\E[1;3Q', NULL.
kf51: '\E[1;3R', NULL.
kf52: '\E[1;3S', NULL.
kf53: '\E[15;3~', NULL.
kf54: '\E[17;3~', NULL.
kf55: '\E[18;3~', NULL.
kf56: '\E[19;3~', NULL.
kf57: '\E[20;3~', NULL.
kf58: '\E[21;3~', NULL.
kf59: '\E[23;3~', NULL.
kf60: '\E[24;3~', NULL.
kf61: '\E[1;4P', NULL.
kf62: '\E[1;4Q', NULL.
kf63: '\E[1;4R', NULL.
kfnd: NULL, '\E[1~'.
khome: '\EOH', NULL.
kind: '\E[1;2B', NULL.
kri: '\E[1;2A', NULL.
kslt: NULL, '\E[4~'.
mc0: '\E[i', NULL.
mc4: '\E[4i', NULL.
mc5: '\E[5i', NULL.
op: '\E[39;49m', '\E[m'.
rep: '%p1%c\E[%p2%{1}%-%db', NULL.
rin: '\E[%p1%dT', NULL.
ritm: '\E[23m', NULL.
rmacs: '\E(B', '^O'.
rmam: '\E[?7l', NULL.
rmcup: '\E[?1049l\E[23;0;0t', '\E[2J\E[?47l\E8'.
rmm: '\E[?1034l', NULL.
rmso: '\E[27m', '\E[m'.
rmul: '\E[24m', '\E[m'.
rs1: '\Ec', NULL.
rs2: '\E[!p\E[?3;4l\E[4l\E>', '\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8'.
setb: '\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m', NULL.
setf: '\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m', NULL.
sgr: '%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m', NULL.
sgr0: '\E(B\E[m', '\E[m'.
sitm: '\E[3m', NULL.
smacs: '\E(0', '^N'.
smam: '\E[?7h', NULL.
smcup: '\E[?1049h\E[22;0;0t', '\E7\E[?47h'.
smm: '\E[?1034h', NULL.
u8: '\E[?%[;0123456789]c', '\E[?1;2c'.
vpa: '\E[%i%p1%dd', NULL.
Just for reference comparing the output of teseq of script(s) output may give a hint:
@@ -41,25 +45,36 @@
: Esc [ H
& CUP: CURSOR POSITION
" Move the cursor to line 1, column 1.
-: Esc [ J
+: Esc [ 2 J
& ED: ERASE IN PAGE
-" Clear from the cursor to the end of the screen.
-|00000000 57 65 64 20 41 70 72 20 20 31 20 30 38 3A 35 39 3A 33 35 20 |-
--| 43 45 53 54 20 32 30 32 30 0A|
+" Clear the screen.
+: Esc [ ? 1 h
+& SM: SET MODE (private params)
+" (DEC) Cursor key mode.
+: Esc =
+& DECKPAM: KEYPAD APPLICATION MODE
+|0|
+: Esc [ 7 b
+& REP: REPEAT
+| 57 65 64 20 41 70 72 20 20 31 20 30 38 3A 35 39 3A 33 35 20 43 45 5|-
+-|3 54 20 32 30 32 30 0A|
This issue and others are open since some years ago. Is time for external help? Maybe a call for help in README.md file can help this nice project.
I finally reproduced this issue through ssh on ubuntu 18.
I was able to reproduce using a minimal prog:
#include <curses.h>
int main() {
initscr(); noecho(); printw("0000000"); getch();
}
IMO this need to be fixed elsewhere!
strangely I'm not able to reproduce this anymore (hexedit-1.4.2), maybe because of my desktop switch from lxde to lxqt... My TERM is xterm-256color and the output of hexedit is "000000" again...
@mokraemer Can you try again but do ssh localhost
first ?
it works with ssh too
@pixel This is driving me nuts. When I compile it as static:
$ gcc -o t t.c /lib/x86_64-linux-gnu/libncurses.a /lib/x86_64-linux-gnu/libtinfo.a
I can reproduce it on my Ubuntu 19.04 system, if I scp
the executable onto my local fedora system I can no longer reproduce it.
@pixel I found the issue. When comparing the output of teseq I noticed this:
& ED: ERASE IN PAGE
" Clear the screen.
|0|
: Esc [ 6 b
& REP: REPEAT
: Esc [ 46 ; 1 H
& CUP: CURSOR POSITION
while in the original one I only see:
& ED: ERASE IN PAGE
" Clear the screen.
|0000000|
: Esc [ 46 ; 1 H
& CUP: CURSOR POSITION
Doing a goodl search on 'REPEAT' eventually lead to:
Great.
Conclusion: some "TERM" from recent terminfo breaks on old terminal applications.
just for later reference. Bug has been fixed in all Debian system:
But not on Ubuntu, so a user has to do:
$ infocmp xterm-256color | sed -e 's/rep=[^,]*, //' | tic -
Now you should have
$ infocmp -x xterm-256color | head -n1
# Reconstructed via infocmp from file: /home/malat/.terminfo/x/xterm-256color
Hi,
In Debian Sid, the hexedit is truncanting the address in first line. See below:
Thanks,
Eriberto