Coder Social home page Coder Social logo

Text abuts edge of window about mosh-chrome HOT 5 CLOSED

rpwoodbu avatar rpwoodbu commented on September 23, 2024
Text abuts edge of window

from mosh-chrome.

Comments (5)

rpwoodbu avatar rpwoodbu commented on September 23, 2024

I have not found this to be a problem. The behavior is the same in the Chrome app Secure Shell, which is the origin of the hterm JS terminal emulator that I'm using. Maybe hterm has a way to set this padding; you should check there first.

I suspect most users would prefer to eek out every last pixel, but I appreciate that this is an aesthetic that is a matter of opinion. I also appreciate that these subtleties can have a significant effect on cognitive load while trying to do hard work. Assuming hterm doesn't have support for this already, I would welcome a contribution that would allow the user to tweak this. If you (or someone else) is willing to take this on, we can discuss the design of such a feature.

from mosh-chrome.

kylecordes avatar kylecordes commented on September 23, 2024

This seems confusing to me when I have more than one mosh window open. The ability to burn a couple of pixels of padding and margin would be extremely helpful and a very good tradeoff.

from mosh-chrome.

rpwoodbu avatar rpwoodbu commented on September 23, 2024

I can definitely see how that may be. Again, I'm happy for someone to contribute this as an optional feature. It should be as easy as setting the style on the div. You should be able to experiment with it easily from the Chrome debugger.

I just added a feature for adding an ssh key, which brings up a new window with a text field. That window could be extended to allow all manner of user configurations, including something like this. If someone wants to do that, I'll be happy to chat about the design.

from mosh-chrome.

gsf avatar gsf commented on September 23, 2024

Unfortunately, it isn't just a CSS change because of the way the divs are layered and the window is drawn. Below is the quick and dirty modification deep in hterm to get a pixel of padding. I have no idea how this would be exposed.

diff --git a/hterm/js/hterm_scrollport.js b/hterm/js/hterm_scrollport.js
index 67d0cf9..f58d326 100644
--- a/hterm/js/hterm_scrollport.js
+++ b/hterm/js/hterm_scrollport.js
@@ -735,10 +735,10 @@ hterm.ScrollPort.prototype.syncRowNodesDimensions_ = function() {
   }

   // Set the dimensions of the visible rows container.
-  this.rowNodes_.style.width = screenSize.width + 'px';
-  this.rowNodes_.style.height = visibleRowsHeight + topFoldOffset + 'px';
-  this.rowNodes_.style.left = this.screen_.offsetLeft + 'px';
-  this.rowNodes_.style.top = this.screen_.offsetTop - topFoldOffset + 'px';
+  this.rowNodes_.style.width = screenSize.width - 1 + 'px';
+  this.rowNodes_.style.height = visibleRowsHeight + topFoldOffset - 1 + 'px';
+  this.rowNodes_.style.left = this.screen_.offsetLeft + 1 + 'px';
+  this.rowNodes_.style.top = this.screen_.offsetTop - topFoldOffset + 1 + 'px';
 };

 hterm.ScrollPort.prototype.syncScrollHeight = function() {

from mosh-chrome.

rpwoodbu avatar rpwoodbu commented on September 23, 2024

Ah, good info, @gsf. That settles it, then: This should be in hterm, not in this project. They're pretty responsive to suggestions (and especially PRs), so if either of you want to bring it up with them, be my guest, and open a bug when they release a new hterm with the change so I can be sure to do a build against it.

from mosh-chrome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.