Skip to content

Commit

Permalink
altscreen implemented, programs not shown on altscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
zokrezyl committed Jun 2, 2020
1 parent 980329b commit 8c95bc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/asciterm_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def on_set_term_title(self, title):
return True

def on_set_term_altscreen(self, screen):
self.parent.altscreen = screen
return True

class ArtSciTerm:
Expand Down Expand Up @@ -207,6 +208,7 @@ def adapt_to_dim(self, width, height):

def __init__(self, args):

self.altscreen = False
self.width = 1000
self.height = 1000
size = args[0].size.split("x")
Expand Down Expand Up @@ -346,8 +348,9 @@ def draw(self, event):

# self.window.clear()
with self.progman_lock:
for internal_id, prog_wrap in self.progman.prog_wraps.items():
prog_wrap.draw(time_now = time_now, mouse = self.mouse)
if not self.altscreen:
for internal_id, prog_wrap in self.progman.prog_wraps.items():
prog_wrap.draw(time_now = time_now, mouse = self.mouse)

self.program.draw(self.program.GL_POINTS)

Expand Down Expand Up @@ -377,7 +380,7 @@ def process(self):
with self.progman_lock:
for internal_id, prog_wrap in self.progman.prog_wraps.items():
prog_wrap.active = False
while True:
while not self.altscreen:
magic_pos = as_str.find(BufferProcessor.magic_string, magic_pos)
if (magic_pos != -1):
int_pos = magic_pos + len(BufferProcessor.magic_string)
Expand Down
2 changes: 1 addition & 1 deletion src/vterm/vterm.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def _on_bell(self, user):
def _on_settermprop(self, prop, val, user):
# TODO .. use this to set the window title...
if prop == VTerm.VTERM_PROP_ALTSCREEN:
self.on_set_term_altscreen(val)
self.on_set_term_altscreen(val.contents.boolean)
elif prop == VTerm.VTERM_PROP_TITLE:
self.on_set_term_title(val.contents.string)
return int(True)
Expand Down

0 comments on commit 8c95bc5

Please sign in to comment.