metal3d / bashsimplecurses

A simple curses library made in bash to draw terminal interfaces
BSD 3-Clause "New" or "Revised" License
902 stars 117 forks source link

The first line of windows always jumps when refreshing #47

Closed M1NGS closed 3 years ago

M1NGS commented 3 years ago

ezgif-2-dcafe3824de4

I have tried some emulation terminals such as xshell and putty with same result.

I used the last version of bashsimplecurses.

test.sh

!/bin/bash

import library, please check path

source /usr/lib/simple_curses.sh

source simple_curses.sh

Then, you must create a "main" function:

main () {

your code here, you can add some windows, text...

window "title" "red" "50%"
append "Text..."
endwin

}

then, you can execute loop:

main_loop 1

rlegene commented 3 years ago

This is caused by endwin which correctly goes to the bottom of the screen and starts the cursor on a new line by itself. I think the error isn't in bashsimplecurses but rather in the example.

M1NGS commented 3 years ago

thanks for your reply, i already solved the problem,because in function refresh,echo "" > $BSC_BUFFER will made a return in $BSC_BUFFER, use > $BSC_BUFFER can empty the file to 0