anchor.diff:           (pos-y    (get-pos-y view x y :modeline modeline)))
       (loop :while (< disp-x disp-x0)
          :for code := (get-charcode-from-scrwin view pos-x pos-y)
  -       :do (incf disp-x (if (lem-base:wide-char-p (code-char code)) 2 1))
  -           (incf pos-x  (if (< code #x10000) 1 2)))
  +       :do (incf disp-x (funcall disp-char-width-fn code))
  +           (incf pos-x  (funcall pos-char-width-fn  code)))
       pos-x))
   (defun get-pos-y (view x y &key (modeline nil))
     (+ y (ncurses-view-y view) (if modeline (ncurses-view-height view) 0)))
   
  +;; for mintty
  +;; get cur-x for moving cursor position properly
  +(defun get-cur-x (view x y &key (modeline nil))
  +  (unless (slot-value *windows-term-setting* 'cur-char-width)
  +    (return-from get-cur-x (get-pos-x view x y :modeline modeline)))
  +  (let* ((disp-char-width-fn (disp-char-width-func))
  +         (pos-char-width-fn  (pos-char-width-func))
  +         (cur-char-width-fn  (cur-char-width-func))
  +         (start-x (ncurses-view-x view))
  +         (disp-x0 (+ x start-x))
  +         (disp-x  0)
  +         (pos-x   0)
  +         (pos-y   (get-pos-y view x y :modeline modeline))
  +         (cur-x   0))
  +    (loop :while (< disp-x disp-x0)
  +       :for code := (get-charcode-from-scrwin view pos-x pos-y)
  +       :do (incf disp-x (funcall disp-char-width-fn code))
  +           (incf pos-x  (funcall pos-char-width-fn  code))
  +           (incf cur-x  (funcall cur-char-width-fn  code)))
  +    cur-x))
  +
   ;; for mintty and ConEmu
   ;; adjust line width by using zero-width-space character (#\u200b)
   (defun adjust-line (view x y &key (modeline nil))
  -  (unless (or (eq *windows-term-type* :mintty)
  -              (eq *windows-term-type* :conemu))
  +  (unless (slot-value *windows-term-setting* 'pos-char-width)
       (return-from adjust-line))
     (let* ((start-x    (ncurses-view-x view))
            (disp-width (ncurses-view-width view))
  
positive.code:    :width width
     :height height))
  
  ;; for mouse
  (defun mouse-get-window-rect (window)
    (values (lem:window-x      window)
            (lem:window-y      window)
            (lem:window-width  window)
            (lem:window-height window)))
  ;; for ConEmu
  ;; get mouse disp-x for pointing wide characters properly
  (defun mouse-get-disp-x (view x y)
    (unless (eq *windows-term-type* :conemu)
      (return-from mouse-get-disp-x x))
    (let* ((start-x (ncurses-view-x view))
           (disp-x0 (+ x start-x))
           (disp-x  start-x)
           (pos-x   start-x)
           (pos-y   (get-pos-y view x y)))
      (loop :while (< pos-x disp-x0)
         :for code := (get-charcode-from-scrwin view pos-x pos-y)
         :do (incf disp-x (if (lem-base:wide-char-p (code-char code)) 2 1))
             (incf pos-x  (if (< code #x10000) 1 2)))
      (- disp-x start-x)))
  (defun mouse-move-to-cursor (window x y)
    (lem:move-point (lem:current-point) (lem::window-view-point window))
  
negative.code: (defun resize-display ()
    (when *resizing*
      (setf *resizing* nil)
      ;; wait to get window size certainly
      (sleep 0.1)
      ;; check resize error
      (when (= (charms/ll:resizeterm 0 0) charms/ll:ERR)
        ;; this is needed to clear PDCurses's inner event flag
        (charms/ll:resizeterm (max 3 charms/ll:*lines*)
                              (max 5 charms/ll:*cols*)))
      (charms/ll:erase)
      ;; workaround for display update problem (incomplete)
      (force-refresh-display charms/ll:*cols* charms/ll:*lines*)))
  