clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
216 stars 71 forks source link

linescrolling not work #509

Open khromenokroman opened 6 months ago

khromenokroman commented 6 months ago

Hello, please tell me, I need to output an array of strings to the terminal, which are many and which are long, can I somehow use less for example? or just more? if only more, how do I make it so that I can scroll sideways, I tried to set the CLICON_CLI_LINESCROLLING parameter to 1, but it didn't help me, I can't scroll sideways, I need your help. I tried to output data using cligen_output(), but it didn't help either, if there are a lot of lines, then it includes more and I can only scroll up and down, but I can't left and right :((


extern "C" int test_print([[maybe_unused]]clixon_handle handle, [[maybe_unused]]cvec *cvv, [[maybe_unused]]cvec *argv) {

    for (int i=0;i!=10000;i++){
        cligen_output(stdout,"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss\n");
    }
    return 0;
}

output:

ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
olofhagsand commented 5 months ago

CLICON_CLI_LINESCROLLING is for INPUT handling. I.e. a long command that wraps. If set to 1 it side-scrolls, if 0 it wraps. Your example is output. Output scrolling using cligen_output() uses line-scroling aka more.

khromenokroman commented 5 months ago

CLICON_CLI_LINESCROLLING is for INPUT handling. I.e. a long command that wraps. If set to 1 it side-scrolls, if 0 it wraps. Your example is output. Output scrolling using cligen_output() uses line-scroling aka more.

more has scrolling to the side if the line is too long, do I understand correctly that I can't do that here?

olofhagsand commented 5 months ago

In my ubuntu more does line wrapping. I was unaware of a more that does scrolling to the side? clixon_cli does line wrapping if the line is too long:

olof@zoomie> show configuration
<services xmlns="http://clicon.org/control
ler">
   <ssh-users xmlns="http://clicon.org/ssh
-users">
   ...
<more>