Skip to content

Commit 4f01d26

Browse files
committed
Revert "avoid garbling of certain multibyte characters ."
This reverts commit a43f970.
1 parent a43f970 commit 4f01d26

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

vterm.el

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ Only background is used."
430430
(defvar-local vterm--redraw-immididately nil)
431431
(defvar-local vterm--linenum-remapping nil)
432432
(defvar-local vterm--prompt-tracking-enabled-p nil)
433-
(defvar-local vterm--undecoded-bytes nil)
434433

435434
(defvar vterm-timer-delay 0.1
436435
"Delay for refreshing the buffer after receiving updates from libvterm.
@@ -961,35 +960,10 @@ be set to BUFFER-NAME, otherwise it will be `vterm'"
961960
Then triggers a redraw from the module."
962961
(let ((inhibit-redisplay t)
963962
(inhibit-read-only t)
964-
(buf (process-buffer process))
965-
(decoded-str))
963+
(buf (process-buffer process)))
966964
(when (buffer-live-p buf)
967965
(with-current-buffer buf
968-
;; Borrowed from term.el
969-
;;
970-
;; Avoid garbling of certain multibyte characters by decoding the string
971-
;; before counting characters. See,
972-
;; https://github.com/akermu/emacs-libvterm/issues/394, and the
973-
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=1006 (for term.el).
974-
(when vterm--undecoded-bytes
975-
(setq input (concat vterm--undecoded-bytes input))
976-
(setq vterm--undecoded-bytes nil))
977-
(setq decoded-str
978-
(decode-coding-string input locale-coding-system t))
979-
(let ((partial 0)
980-
(count (length decoded-str)))
981-
(while (and (< partial count)
982-
(eq (char-charset (aref decoded-str
983-
(- count 1 partial)))
984-
'eight-bit))
985-
(cl-incf partial))
986-
(when (> count partial 0)
987-
(setq vterm--undecoded-bytes
988-
(substring decoded-str (- partial)))
989-
(setq decoded-str
990-
(substring decoded-str 0 (- partial)))))
991-
992-
(vterm--write-input vterm--term decoded-str)
966+
(vterm--write-input vterm--term input)
993967
(vterm--update vterm--term)))))
994968

995969
(defun vterm--sentinel (process event)

0 commit comments

Comments
 (0)