From 074f63ff31e3d9b1ee88bdc7ed443e01f97943dc Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 19 Jun 2022 02:44:00 +0200 Subject: [PATCH] fix(cli): ignore invalid __DOOMGEOM value --- core/core-cli-lib.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/core-cli-lib.el b/core/core-cli-lib.el index 0a5b27c77..eaa71f475 100644 --- a/core/core-cli-lib.el +++ b/core/core-cli-lib.el @@ -576,11 +576,11 @@ Throws `doom-cli-invalid-option-error' for illegal values." (string-to-number step) -1)) ;; The geometry of the terminal window. - (geometry (when-let* ((geom (getenv "__DOOMGEOM")) - ((not (string-blank-p geom))) - (geom (split-string geom "x"))) - (cons (string-to-number (car geom)) - (string-to-number (cadr geom))))) + (geometry (save-match-data + (when-let* ((geom (getenv "__DOOMGEOM")) + ((string-match "^\\([0-9]+\\)x\\([0-9]+\\)$" geom))) + (cons (string-to-number (match-string 1 geom)) + (string-to-number (match-string 2 geom)))))) ;; Whether the script is being piped into or out of (pipes (cl-loop for (env . scope) in `((,(getenv "__DOOMGPIPE") . global) (,(getenv "__DOOMPIPE") . local))