2

So what I am trying to do it so simulate clearing screen of Eclipse terminal.

I know there isn't a real solution for clearing the screen so I know I must use tons of empty lines to clear the screen.

The problem is that when I do tons of new line characters the pointer would be at the bottom of the terminal.

How would I do this so I would end up with pointer at the top of terminal and entire view would appear clear of any text?

So it would look like Aircrack-ng like interface. The screen keep changing but only by scrolling down and updating the content, etc.

4

1 に答える 1

1

基本的に必要なのは、 clrtobot curses関数をエミュレートすることです。どれの:

カーソルから画面の最後まで消去します。つまり、ウィンドウ内のカーソルの下にあるすべての行を消去します。また、カーソルの右側にある現在の行も消去されます。

window$には「cls」関数があるため、次のようなものを使用する必要があります

Runtime.getRuntime().exec("cls");

ほとんどの*nixには「クリア」機能があります。ただし、これはさまざまであるため、このソリューションにあまり依存しないでください。ただし、次のようなものを使用できます。

Runtime.getRuntime().exec("clear");

OSに依存しないソリューションはまだ見ていません。

お役に立てば幸いです。乾杯

于 2012-11-22T01:50:57.683 に答える