New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 633924 link

Starred by 5 users

Issue metadata

Status: Verified
Owner:
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Chrome
Pri: 2
Type: Bug

Blocked on:
issue 648845



Sign in to add a comment

hterm: last line disappears depending on zoom level

Project Member Reported by drinkcat@chromium.org, Aug 3 2016

Issue description

CHROMEOS_RELEASE_DESCRIPTION: 8350.55.0 (Official Build) beta-channel

What steps will reproduce the problem?
1. ssh into your corp machine
2. type seq 1000 a few times: scrolling through lots of text triggers this.
3. Last terminal line is lost, see screenshot, then should be a "drinkcat@drinkcat:~$" on the last line.

What is the expected result?

Last line is not lost.

What happens instead of that?

Can't use the terminal, need to restart hterm.

Please provide any additional information below. Attach a screenshot if
possible.

From internal thread:

drinkcat@: I think there is something weird happening with the (now) default resolution 1536x864 and scaling. Changing back the resolution to 1920x1080 fixes the problem. (All at 100% zoom)

- Using 1920x1080 + 125%/150% zoom also triggers the issue. Or 1536x864 + 110%.
- 1920x1080 +110% is fine. So is 1536x864 + 90%/75%/125%.

Feels like some rounding error... I tried the dev version as well (0.8.34.2), same issue.

---

rginda@: The browser zoom function in chrome causes problems for hterm.  As a result, hterm is only known to work at 100% browser zoom.  At other zoom levels it will depend on the font, window size, and operating system.

---

abodenha@: The new device scale model fixes a lot of really serious issues. It's unfortunate that hterm can't deal with it.

---

oshima@: *In theory*, web app should work with any zooming (because apps can't tell zoom level), and if it doesn't, it's a bug.
Can I take a look at the code that does not work with zooming?

--

abodenha@: It's probably somewhere in the hterm.ScrollPort.prototype.measureCharacterSize function which attempts to measure the size of a character.  Or it could be in syncRowNodesDimensions_ which determines the number of text rows/columns that should be visible.
 
 Issue 645207  has been merged into this issue.

Comment 2 Deleted

This is happening even when I minimize my browser/CrOSH window on lulu 
and even without tweaking any zoom settings. I tried the default as well as higher/lower resolutions-  I hit this problem sooner or later. My work requires to cat large chunks of data from /var/log/messages, so this is a bit annoying, having to hit Ctrl-L after each command. Maybe I should edit my bashrc to append a clear to each command or something? 

Comment 4 Deleted

Re#3: Press Ctrl+- will show you that last hidden line. 
There seems to be a rounding error in hterm.ScrollPort.prototype.getTopRowIndex() [1]. This function always returns (the correct top row index - 1) when the bug is reproduced. Who owns this code?


[1]: https://cs.corp.google.com/webstore/crx/d/djddabimpcicofmjnlkahgbbpfigocpn/js/nassh_deps.concat.js?type=cs&q=f:+nassh_deps&l=10101
Labels: Restrict-View-Google
Best to avoid posting links to internal repos in public bugs.

Comment 9 by osh...@chromium.org, Sep 10 2016

I think it just needs to compute the height of character using multiple lines like it does for width.
I fixed it locally as Oshima suggested by calculating the character height. I can send a CL.
Labels: -Restrict-View-Google
hterm/nassh/libapps is all public code.  internal links are irrelevant.
Project Member

Comment 12 by bugdroid1@chromium.org, Sep 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/7354202ec171287e200ec075c40e34784005fa97

commit 7354202ec171287e200ec075c40e34784005fa97
Author: Ahmed Fakhry <afakhry@google.com>
Date: Wed Sep 14 00:18:48 2016

Fix hterm's last line disappearing depending on the zoom level

We need to average the height of the character the same way we average the width to
avoid rounding errors.

BUG= chromium:633924 
TEST=mkdeps.sh, mkzip.sh --nopromote and then load it on the device and try seq 1000 several times. The last line shouldn't disappear

Change-Id: I0d0dfe749a6e02f8023e2709c7222446d6e136e0
Reviewed-on: https://chromium-review.googlesource.com/385075
Reviewed-by: Rob Ginda <rginda@chromium.org>
Tested-by: Rob Ginda <rginda@chromium.org>

[modify] https://crrev.com/7354202ec171287e200ec075c40e34784005fa97/hterm/js/hterm_scrollport.js

What do we need to do in order to release a new version for Hterm using the fix in #12 to be part of ChromeOS? Or does that happen automatically?
rob or i will take care of it.  we need to do one anyways for the breakage in canary builds.
this seems to be breaking horizontal cursor position tracking

i have a 1599x899 pixel window which is 204x58.  when writing a long line, the cursor slowly falls out of sync.  see attached screenshots -- the cursor should have been to the right of the "f" in every one, but it drifted.
cursor-left.png
12.0 KB View Download
cursor-mid.png
12.8 KB View Download
cursor-right.png
13.0 KB View Download
that is SecureShell (beta) 0.8.34.3

Comment 17 by rginda@google.com, Sep 15 2016

In order to get this into the default version of crosh that ships as part of the ChromeOS image, you'll have to update crosh.  See https://chromium.googlesource.com/chromiumos/platform/assets/+/master/chromeapps/crosh_builtin/
Re#15: Do you mean the change in #12 broke the cursor tracking?
i'm fairly certain that is the case.  0.8.34.2 works.  the only changes in 0.8.34.3 are:
bf85c3b1f30696dca576bfdcb285ca11055876e5: hterm: disable ligatures
15ed49071379e51ae47d929134366eb156a6943a: copySelectionToClipboard fixes.
7354202ec171287e200ec075c40e34784005fa97: Fix hterm's last line disappearing depending on the zoom level
b976c0b956121d3e10934dea16d61417b6b17f1d: hterm: fix order of parameters to postMessage

seems highly unlikely any of the other commits caused this.
I'll take a look at what happened. I think I have an idea where the problem is.
i've verified that reverting your CL fixes the drift

i'd like to post a new dev version by thur evening, so if you can't fix by then, i'll have to revert.  i'm not saying this as a threat, i just don't have a choice.  there's a bug where SecureShell doesn't work in M54+ and we need to get that fix out by monday which means we need a version in testing before that.  you can always reland.
I've just uploaded a fix.
Project Member

Comment 23 by bugdroid1@chromium.org, Sep 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/apps/libapps/+/ccbc9ba0f0015da2b545dfb1751496eeeb92a5f6

commit ccbc9ba0f0015da2b545dfb1751496eeeb92a5f6
Author: Ahmed Fakhry <afakhry@google.com>
Date: Thu Sep 15 16:04:24 2016

Fix hterm horizontal cursor position tracking

A regression caused by https://chromium-review.googlesource.com/#/c/385075/3
that resulted in another round error causing the horizontal cursor position
to be wrong when filling the line with characters.
This CL fixes the problem.

BUG= chromium:633924 
TEST=mkdeps.sh, mkzip.sh --nopromote, load it on device, and type
until the line wraps around. Cursor position should remain correct.

Change-Id: Idfc51a1eddf0ef53949822498ac57c89d51d5d7f
Reviewed-on: https://chromium-review.googlesource.com/385916
Reviewed-by: Rob Ginda <rginda@chromium.org>
Tested-by: Rob Ginda <rginda@chromium.org>

[modify] https://crrev.com/ccbc9ba0f0015da2b545dfb1751496eeeb92a5f6/hterm/js/hterm_scrollport.js

I noticed crosh hasn't been updated yet. Should I go ahead and do that?
Status: Fixed (was: Started)
no need ... i have CLs in flight to rework how crosh is integrated into builds
Awesome. Thanks!
i opened  issue 648422  for that if you want to follow along.  once the CQ starts working again we can start landing things.  then CrOS ToT will follow ToT crosh/hterm automatically.
Blockedon: 648845
Status: Verified (was: Fixed)
Verified on Chrome OS 9202.1.0, 57.0.2987.6

Comment 30 Deleted

Sign in to add a comment