about summary refs log tree commit diff stats
path: root/src/local/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-25 20:25:04 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-25 20:25:04 +0100
commit92fbf479f8bf6db6ad0655e5b71a0b58a45a2213 (patch)
tree47b7f2c23ebabbf94e48476615014b52762542f3 /src/local/client.nim
parent4df71520f39ed7992f78484701467e513a34c5dc (diff)
downloadchawan-92fbf479f8bf6db6ad0655e5b71a0b58a45a2213.tar.gz
term: improve pixels-per-column/line detection
Some terminal emulators (AKA vte) refuse to set ws_xpixel and ws_ypixel
in the TIOCGWINSZ ioctl, so we now query for CSI 14 t as well. (Also CSI
18 t for good measure, just in case we can't ioctl for some reason.)

Also added some fallback (optionally forced) config values for width,
height, ppc, and ppl. (This is especially useful in dump mode.)
Diffstat (limited to 'src/local/client.nim')
-rw-r--r--src/local/client.nim7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/local/client.nim b/src/local/client.nim
index 71aaac8c..d088982f 100644
--- a/src/local/client.nim
+++ b/src/local/client.nim
@@ -18,7 +18,6 @@ import bindings/quickjs
 import config/config
 import display/lineedit
 import display/term
-import display/winattrs
 import html/chadombuilder
 import html/dom
 import html/event
@@ -437,8 +436,7 @@ proc inputLoop(client: Client) =
         client.handleError(event.fd)
       if Signal in event.events:
         assert event.fd == sigwinch
-        let attrs = getWindowAttributes(client.pager.infile)
-        client.pager.windowChange(attrs)
+        client.pager.windowChange()
       if selectors.Event.Timer in event.events:
         let r = client.timeouts.runTimeoutFd(event.fd)
         assert r
@@ -690,8 +688,7 @@ proc newClient*(config: Config, forkserver: ForkServer): Client =
   let jsrt = newJSRuntime()
   JS_SetModuleLoaderFunc(jsrt, normalizeModuleName, clientLoadJSModule, nil)
   let jsctx = jsrt.newJSContext()
-  let attrs = getWindowAttributes(stdout)
-  let pager = newPager(config, attrs, forkserver, jsctx)
+  let pager = newPager(config, forkserver, jsctx)
   let client = Client(
     config: config,
     forkserver: forkserver,