From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.bugs Subject: bug#57821: 29.0.50; ANSI sequence not filtered in compilation buffer Date: Fri, 16 Sep 2022 22:59:21 +0200 Message-ID: <87y1ujyr12.fsf@gmail.com> References: <87fsgt11w0.fsf@gmail.com> <87bkrg28lu.fsf@gmail.com> <877d23a7mh.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26631"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 57821@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 16 23:00:18 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oZIRe-0006gj-2R for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 23:00:18 +0200 Original-Received: from localhost ([::1]:48658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZIRc-00006T-IK for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 17:00:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZIRO-00006L-R3 for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 17:00:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45375) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZIRO-00080b-Bt for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 17:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZIRN-0006jX-TO for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 17:00:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matthias Meulien Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 21:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57821 X-GNU-PR-Package: emacs Original-Received: via spool by 57821-submit@debbugs.gnu.org id=B57821.166336197125816 (code B ref 57821); Fri, 16 Sep 2022 21:00:01 +0000 Original-Received: (at 57821) by debbugs.gnu.org; 16 Sep 2022 20:59:31 +0000 Original-Received: from localhost ([127.0.0.1]:44453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZIQt-0006iJ-2k for submit@debbugs.gnu.org; Fri, 16 Sep 2022 16:59:31 -0400 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:46987) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZIQq-0006i4-V8 for 57821@debbugs.gnu.org; Fri, 16 Sep 2022 16:59:30 -0400 Original-Received: by mail-wr1-f52.google.com with SMTP id g3so17012663wrq.13 for <57821@debbugs.gnu.org>; Fri, 16 Sep 2022 13:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=B6DVUNG4vGBzdR6SH9PGaH9NgSzXZA/9VxlEC/nspoo=; b=Wq4NtmXQJKj+1VGviEBC9IMcJ+6F0flE7ceSyHCq4GkZN1vUIBRMWjwnEYhW9n5AFe 6BLxnyn4HGf4yeEBxcePVo6SvRBlBx5BhfK1T5FupQAujLwJOLsNNZaD2QMxJpoXzyU7 JByX9vtiuhPfTOuAKPFHWNwah9FqxKW1Ulc8PT4uog33BgCrO0V9Ush+vcwc+NXDLXdH 9lXvS1C9lQr/qqE/mtDv2HpL7dUeQWX8A9lCD5N4XToSH7kDLgwpsVBVTgckXFgXuIPK qguGwn8K6/uPiQIZZ5aMrkI09PpuA4y2L0jqLuLouCCeYudZ0OI1AxcJuDoMI9Zotdpa 9uWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=B6DVUNG4vGBzdR6SH9PGaH9NgSzXZA/9VxlEC/nspoo=; b=SywYewFoBDrZMOLzawUOeSkG3iT1UAaEIz1gzz52mXtk9YnUeoWjYZH59rECgPWZ5Q mo1LUZIPu+M6/VHvmsSsN1oMx+FKcIQjVXnIkwrJ2UJY0umby5/VF5wOqXxZIyG7NqM2 Oh9p7Fg9d+p1LA2P0CbabZEmFSWtu0hETRr4XY+KNecP7nvWl8dyhgu3I6dUfeleemKj zEX663Bw0GEdGWC+T+l9/yplmREoBH79bXxK17ES8QV6MQLSMw0uXpfYx7zRj3heqoix qne17jejghIaNeVrQ1iQJ1NYAakQ5yD2yqLQCL665WCUy8XAxuaY9D1hZJdwpYPl8uP5 q8QA== X-Gm-Message-State: ACrzQf3eRoTf4i/M07Stsf7dMP+kE0MCxLhBs9/Lnvr7oSMzkBMxRaEz nchyydwdJSNVbXEcP1t4c63Vh6nwFis= X-Google-Smtp-Source: AMsMyM4p/96i+vBlc6M0AEkJ6M1S3jgMsHnHcOpyOfY7tOXzgicXdAEVVTsfvMCxKhnoPPzYtEFGXQ== X-Received: by 2002:a5d:438a:0:b0:228:d5da:b442 with SMTP id i10-20020a5d438a000000b00228d5dab442mr3950690wrq.89.1663361962739; Fri, 16 Sep 2022 13:59:22 -0700 (PDT) Original-Received: from carbon.localdomain ([2a01:e0a:245:c850:98f5:429a:aa8e:95bb]) by smtp.gmail.com with ESMTPSA id l32-20020a05600c1d2000b003a845fa1edfsm7960050wms.3.2022.09.16.13.59.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 13:59:22 -0700 (PDT) In-Reply-To: <877d23a7mh.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 16 Sep 2022 13:20:06 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242811 Archived-At: Lars Ingebrigtsen writes: > Matthias Meulien writes: > >> The OSC sequences sent by flatpak-builder are meant to update the window >> title (See https://terminalguide.namepad.de/seq/osc-2/). I plan to >> provide an osc-compilation-filter (modelled on >> ansi-color-compilation-filter) to be added to compilation-filter-hook. >> >> One possible mode is to filter out all osc sequences. An other mode >> would be to call per command handlers as done by >> comint-osc-process-output. >> >> Any thought? > > The default could be to filter out all unknown OSC sequences? Yes. The following already achieves this: (defconst osc-control-seq-regexp ;; See ECMA 48, section 8.3.89 "OSC - OPERATING SYSTEM COMMAND". "\e\\][\x08-\x0D]*[\x20-\x7E]*\\(\a\\|\e\\\\\\)" "Regexp matching an OSC control sequence.") (defun osc-filter-region (begin end) "Filter out all OSC control sequences from region BEGIN to END." (save-excursion (goto-char begin) ;; Delete escape sequences. (while (re-search-forward osc-control-seq-regexp end t) (delete-region (match-beginning 0) (match-end 0))))) (defun osc-compilation-filter () (let ((inhibit-read-only t)) (osc-filter-region compilation-filter-start (point)))) (add-hook 'compilation-filter-hook #'osc-compilation-filter) I'll try to implement the `osc-compilation-filter' this week-end. What would be the right place for this, progmodes/compile.el? A new osc.el file? Side notes: 1. I just learnt about the optional COMINT argument of `compile': It solves the original problem of filtering OSC sequences from compilation output buffers; One has to add `comint-osc-process-output' to `comint-output-filter-functions' and then must call `compile' with universal argument... 2. With the patch attached to bug#57866 installed, OSC 2 sequences are collected from comint buffers and the frame title can be updated. -- Matthias