From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: comint-output-filter-functions and multi-line input Date: Sun, 16 Oct 2022 08:48:11 +0000 Message-ID: <87y1tgqhmc.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25923"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 16 10:48:45 2022 Return-path: Envelope-to: ged-emacs-devel@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 1ojzK9-0006Xp-F0 for ged-emacs-devel@m.gmane-mx.org; Sun, 16 Oct 2022 10:48:45 +0200 Original-Received: from localhost ([::1]:46984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojzK8-0004xk-DE for ged-emacs-devel@m.gmane-mx.org; Sun, 16 Oct 2022 04:48:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojzIv-0004GN-W1 for emacs-devel@gnu.org; Sun, 16 Oct 2022 04:47:30 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:48817) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojzIt-0000Fs-Iq for emacs-devel@gnu.org; Sun, 16 Oct 2022 04:47:29 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 412E4240103 for ; Sun, 16 Oct 2022 10:47:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665910045; bh=EwSVnKIoPnk8hhKrGFD93EhekeGI4bCrAKyUnnLvfuY=; h=From:To:Subject:Date:From; b=E5zPv+jjSnZ0u+Ny49VzznUH2SsmMl4j9CxIg/hMkEjsTRQvC9bOG8c1gsCk0uqVb UWUw4l5rcoNDHpmVGOm6mfxFsFrM+2FB6SFB5zuSTfDvcfqZXS8Zn0rDnO8Zm/gr+u 5+dZTeBtmHyRn0HOrevko2myvP1E4xJ9am9zIY5CuygDY6eWr7w9dhXVsuM7pXEwpw Br86d5Tr1dlfupP+mvEk2ELHK4gW54OyTD6Irs1+Tp4NM9FGSAFZRgqsQy3Vsf1DHH k456J8VxCLDOx+xwUxv8r74/v5nqTNNs4a256pt2BSHauUxunK/xcASfUvkxV6eVEG p2t1myxrysiKQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Mqtzb3Gh6z6tmR for ; Sun, 16 Oct 2022 10:47:22 +0200 (CEST) Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:297841 Archived-At: Hello, I am trying to figure out how to programmatically capture output of a multi-line bash script in comint buffer. Consider: [yantar92:/tmp] $ > if true > then > echo "hello" > fi hello Each line is submitted to shell via comint-send-input and, AFAIK, the result can be collected using `comint-output-filter-functions'. I expect the `comint-output-filter-functions' to be called on "hello" line. However, it does not seem to be the case. Empty "" corresponding to "> " PS2 prompts upon sending incomplete script lines are also passed. Is it possible to distinguish the actual script output, empty lines in the actual script output, and the incomplete prompts? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at