Skip to content

Commit

Permalink
terminal.py: Disabled non-autowrap mode. There's just no way to get l…
Browse files Browse the repository at this point in the history
…ines longer than the screen (in the browser) without it messing up edge cases all over the place.

gateone.js:  Fixed the bug where disabling transitions wasn't working (the setting wasn't being restored on page reload).
gateone.js:  `GateOne.Visual.stopIndicator()` now takes `GateOne.prefs.disableTransitions` into account when it does its thing.  If you have transitions disabled it will set a shorter timeout and won't change the opacity.
  • Loading branch information
liftoff committed Sep 28, 2013
1 parent 18ea3d1 commit 3e909be
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion gateone/gateone.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__version_info__ = (1, 2, 0)
__license__ = "AGPLv3" # ...or proprietary (see LICENSE.txt)
__author__ = 'Dan McDougall <[email protected]>'
__commit__ = "20130928141238" # Gets replaced by git (holds the date/time)
__commit__ = "20130928142525" # Gets replaced by git (holds the date/time)

# NOTE: Docstring includes reStructuredText markup for use with Sphinx.
__doc__ = '''\
Expand Down
21 changes: 15 additions & 6 deletions gateone/static/gateone.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 16 additions & 14 deletions terminal/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
from itertools import imap, izip

# Inernationalization support
_ = str # So pyflakes doesn't complain
import gettext
gettext.install('terminal')

Expand Down Expand Up @@ -1959,7 +1960,7 @@ def send_message(self, message):
try:
for callback in self.callbacks[CALLBACK_MESSAGE].values():
callback(message)
except TypeError as e:
except TypeError:
pass

def send_update(self):
Expand All @@ -1970,7 +1971,7 @@ def send_update(self):
try:
for callback in self.callbacks[CALLBACK_CHANGED].values():
callback()
except TypeError as e:
except TypeError:
pass

def send_cursor_update(self):
Expand All @@ -1981,7 +1982,7 @@ def send_cursor_update(self):
try:
for callback in self.callbacks[CALLBACK_CURSOR_POS].values():
callback()
except TypeError as e:
except TypeError:
pass

def reset(self, *args, **kwargs):
Expand Down Expand Up @@ -2394,7 +2395,6 @@ def write(self, chars, special_checks=True):
self.cursorY, self.cursorX))
split_capture = ft_instance.re_capture.split(self.capture,1)
before_chars = split_capture[0]
capture_length = len(split_capture[1])
self.capture = split_capture[1]
after_chars = b"".join(split_capture[2:])
if after_chars:
Expand Down Expand Up @@ -2453,7 +2453,6 @@ def write(self, chars, special_checks=True):
except AttributeError:
# In Python 3 strings don't have .decode()
pass # Already Unicode
backspaced = False
for char in chars:
charnum = ord(char)
if charnum in specials:
Expand Down Expand Up @@ -2507,14 +2506,16 @@ def write(self, chars, special_checks=True):
continue # We're done here
changed = True
if self.cursorX >= self.cols:
self.cursorX = 0
self.newline()
# Non-autowrap has been disabled due to issues with browser
# wrapping.
if self.expanded_modes['7']:
self.cursorX = 0
self.newline()
else:
self.screen[self.cursorY].append(u' ') # Make room
self.renditions[self.cursorY].append(u' ')
#if self.expanded_modes['7']:
#self.cursorX = 0
#self.newline()
#else:
#self.screen[self.cursorY].append(u' ') # Make room
#self.renditions[self.cursorY].append(u' ')
try:
self.renditions[self.cursorY][
self.cursorX] = self.cur_rendition
Expand Down Expand Up @@ -3279,6 +3280,7 @@ def cursor_left(self, n=1):
try:
char = self.screen[self.cursorY][self.cursorX]
except IndexError: # Cursor is past the right-edge of the screen; ignore
print("cursor_left() IndexError")
char = u' ' # This is a safe default/fallback
if unicodedata.east_asian_width(char) == 'W':
# This lets us skip the next call (get called 2x for 2x width)
Expand Down Expand Up @@ -3748,7 +3750,7 @@ def _opt_handler(self, chars):
try:
for callback in self.callbacks[CALLBACK_OPT].values():
callback(chars)
except TypeError as e:
except TypeError:
# High likelyhood that nothing is defined. No biggie.
pass

Expand Down Expand Up @@ -4022,11 +4024,11 @@ def dump_html(self, renditions=True):
for y, row in enumerate(self.screen):
if y == cursorY:
cursor_row = ""
for x, c in enumerate(row):
for x, char in enumerate(row):
if x == cursorX:
cursor_row += (
'<span class="%scursor">%s</span>' % (
self.class_prefix, c))
self.class_prefix, char))
else:
cursor_row += char
screen.append(cursor_row)
Expand Down

0 comments on commit 3e909be

Please sign in to comment.