When I run vim or from above from the console, they can take over the entire console. When I leave, I will return to the console.
Can this be made from ruby? As a simple example, how would I do the following
# Rakefile task :clock do loop do console.render Time.now sleep 1 end end
when I run this, the console will be cleared and the first line will show the time. When I leave, I will continue the console session, as it was before I started the rake clock.
Update
Checking the tictactoe example for ruby ββcurses, here is an example of an example synchronization. I showed the clock on random lines to demonstrate the update of the entire console.
#!/usr/bin/env ruby require 'curses' loop do Curses.clear Curses.setpos(rand * 10, 0) Curses.addstr(Time.now.to_s); Curses.refresh sleep 1 end
opsb
source share