AmokHuginnsson / replxx

A readline and libedit replacement that supports UTF-8, syntax highlighting, hints and Windows and is BSD licensed.
Other
689 stars 107 forks source link

What's the correct way to handle SIGWINCH #99

Open amosbird opened 3 years ago

amosbird commented 3 years ago

When terminal gets resized, clickhouse-client (an replxx application) fails to render the display correctly unless it resets the current replxx-state. I wonder if there is any example I can refer to.

AmokHuginnsson commented 3 years ago

Does afb020a292ce7feb0363b3ed1fdc6a3ac337d7b3 improve your experience?

amosbird commented 3 years ago

Does afb020a improve your experience?

Unfortunately nope. Nothing changed.

AmokHuginnsson commented 3 years ago

Do you call install_window_change_handler() in the client in the beginning?

amosbird commented 3 years ago

install_window_change_handler() That works!

There is one tiny issue left. After resizing, syntax highlighting gets lost. I have to input some actions such as moving cursors around to get it back.

edit

Just found another issue. When doing terminal shrink, replxx rerenders current line but somehow in a new line, with one line duplicated. Here is the screencast describing the issue http://oracle.wentropy.com/b5decbe52268770c

AmokHuginnsson commented 3 years ago

Current master should fix color issue. But I haven't read your edit before I started working on syntax highlighting.

amosbird commented 3 years ago

Current master should fix color issue.

Awesome

But I haven't read your edit before I started working on syntax highlighting.

That just means you're super productive :)

AmokHuginnsson commented 3 years ago

I can reproduce duplicated line issue only in tmux, raw terminals do not show this problem.

amosbird commented 3 years ago

I can reproduce duplicated line issue only in tmux, raw terminals do not show this problem.

Hmm, what does that imply? I thought tmux should obey the terminal standard.

AmokHuginnsson commented 3 years ago

Hmm, what does that imply? I thought tmux should obey the terminal standard.

I do not know yet.

AmokHuginnsson commented 3 years ago

Ok, most terminals express this behavior (also GNU screen), the only unaffected terminals I found are xterm and rxvt derivatives (running without any terminal multiplexer).