Issue Description
Toggling nested checkboxes via M-x org-toggle-checkbox RET causes weird visual artifact where gets checkboxes gets duplicated as well the Headline when folding. This only happens inside Emacs TTY emacs -nw and not in Emacs GUI. Here's a video demonstrating the bug:
Screencast_20260531_203025.mp4
Steps to Reproduce:
Launch Emacs tty emacs -nw.
Open an Org file and paste the below sample text:
* CHECKBOX
- [ ] Task 1
- [ ] sub-task 1
- [ ] sub-task 2
Now with org-modern-mode enabled, toggle the checkbox labeled sub-task 2 using command org-toggle-checkbox.
Now the checkbox labelled sub-task 1 is duplicated (visually) .
Now move the point towards the headline and try to fold and unfold, now the headline is duplicated (visually).
Selecting the the entire element with the mouse leads to more artifacts.
Now disable the org-modern-mode M-x org-modern-mode RET and the visual artifacts are gone.
NOTE:
This only happens within the Emacs tty, GUI seems unaffected.
Minimal init file:
(defvar elpaca-installer-version 0.12)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-sources-directory (expand-file-name "sources/" elpaca-directory))
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
:ref nil :depth 1 :inherit ignore
:files (:defaults "elpaca-test.el" (:exclude "extensions"))
:build (:not elpaca-activate)))
(let* ((repo (expand-file-name "elpaca/" elpaca-sources-directory))
(build (expand-file-name "elpaca/" elpaca-builds-directory))
(order (cdr elpaca-order))
(default-directory repo))
(add-to-list 'load-path (if (file-exists-p build) build repo))
(unless (file-exists-p repo)
(make-directory repo t)
(when (<= emacs-major-version 28) (require 'subr-x))
(condition-case-unless-debug err
(if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
((zerop (apply #'call-process `("git" nil ,buffer t "clone"
,@(when-let* ((depth (plist-get order :depth)))
(list (format "--depth=%d" depth) "--no-single-branch"))
,(plist-get order :repo) ,repo))))
((zerop (call-process "git" nil buffer t "checkout"
(or (plist-get order :ref) "--"))))
(emacs (concat invocation-directory invocation-name))
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
((require 'elpaca))
((elpaca-generate-autoloads "elpaca" repo)))
(progn (message "%s" (buffer-string)) (kill-buffer buffer))
(error "%s" (with-current-buffer buffer (buffer-string))))
((error) (warn "%s" err) (delete-directory repo 'recursive))))
(unless (require 'elpaca-autoloads nil t)
(require 'elpaca)
(elpaca-generate-autoloads "elpaca" repo)
(let ((load-source-file-function nil)) (load "./elpaca-autoloads"))))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
;; Install use-package support
(elpaca elpaca-use-package
;; Enable use-package :ensure support for Elpaca.
(elpaca-use-package-mode))
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(use-package org-modern
:ensure t
:hook
(org-mode . org-modern-mode)
(org-agenda-finalize . org-modern-agenda)
:custom
(org-modern-star 'replace)
(org-modern-table nil)
(line-spacing 0.4))
Additional Information
Emacs version: GNU Emacs 30.2
Org-modern : 1.13
Issue Description
Toggling nested checkboxes via
M-x org-toggle-checkbox RETcauses weird visual artifact where gets checkboxes gets duplicated as well the Headline when folding. This only happens inside Emacs TTYemacs -nwand not in Emacs GUI. Here's a video demonstrating the bug:Screencast_20260531_203025.mp4
Steps to Reproduce:
emacs -nw.sub-task 2using commandorg-toggle-checkbox.sub-task 1is duplicated (visually) .M-x org-modern-mode RETand the visual artifacts are gone.Minimal init file:
Additional Information
Emacs version: GNU Emacs 30.2
Org-modern : 1.13