From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Antoine Levitt" Newsgroups: gmane.emacs.devel Subject: Re: [Patch] Resizing shells in shell-mode Date: Sat, 24 May 2008 23:58:49 +0200 Message-ID: <6fa54e4e0805241458k54294d58x65bf6655c2bc6f7f@mail.gmail.com> References: <6fa54e4e0805241138s7ca3428ay976f4331b86b89e6@mail.gmail.com> <6fa54e4e0805241323t75e6e82cldb3e71663632bc2f@mail.gmail.com> <87zlqfe7zz.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_985_30897072.1211666329421" X-Trace: ger.gmane.org 1211666343 12687 80.91.229.12 (24 May 2008 21:59:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 May 2008 21:59:03 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: "Miles Bader" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 24 23:59:44 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K01mB-0001Lb-Du for ged-emacs-devel@m.gmane.org; Sat, 24 May 2008 23:59:43 +0200 Original-Received: from localhost ([127.0.0.1]:34272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K01lQ-0004dy-Qi for ged-emacs-devel@m.gmane.org; Sat, 24 May 2008 17:58:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K01lM-0004dt-6u for emacs-devel@gnu.org; Sat, 24 May 2008 17:58:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K01lK-0004dV-WB for emacs-devel@gnu.org; Sat, 24 May 2008 17:58:51 -0400 Original-Received: from [199.232.76.173] (port=35057 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K01lK-0004dS-QC for emacs-devel@gnu.org; Sat, 24 May 2008 17:58:50 -0400 Original-Received: from wa-out-1112.google.com ([209.85.146.182]:23601) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K01lK-0001lx-5F for emacs-devel@gnu.org; Sat, 24 May 2008 17:58:50 -0400 Original-Received: by wa-out-1112.google.com with SMTP id m34so1800263wag.10 for ; Sat, 24 May 2008 14:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=7o16DPgdu5rafbbu704fCwiokjuc1Ss2IfrIs04aU50=; b=t6sehGHe5Zps6R3L6mKXh4m82iWIoVxMrnW2FCpjMQQeoX2ffTiOySmGCi1DJEoSH6WouZswyo4qt26z9XryQBSyDi7D2oXz75QlPaFHuHA8GjIiMCo7awt9fCpZ0BomBpy9TeMz3FsaJ65TjqtJ7iuAhR03ti6x3rerrtzKF7U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=OF4Llg2oX5RsOlFagvJUFTZffwh9Q1xgWgm3bV0wazQDpxncGwJjp3MHG1JzoxLw8qf3icb8gxeYpIB841NYN4Sv5/0aHSQWuFRkaBawqzToikg28weh6xaJKF+Lp+YmHWS3yy7rZeCl1FKKc4m2P5xgX2bpRXxpTypzYv6eHh8= Original-Received: by 10.114.37.1 with SMTP id k1mr3590065wak.6.1211666329426; Sat, 24 May 2008 14:58:49 -0700 (PDT) Original-Received: by 10.115.95.6 with HTTP; Sat, 24 May 2008 14:58:49 -0700 (PDT) In-Reply-To: <87zlqfe7zz.fsf@catnip.gol.com> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:97669 Archived-At: ------=_Part_985_30897072.1211666329421 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline And I did it again, sorry. Here is the original message : Aww, I can't believe I haven't thought about this earlier. You're right, of course. I'm sorry for not thinking this through (this problem also occurs with shell-copy-environment-variable, but I don't know how this is used so it may actually not be a problem) Hmm, so, a solution would be to check for a prompt (there's already a regexp to do just that) and only change columns when there's one on the line (so it also matches prompts with a partially typed command) (bad, might be noticeable under certain (rare) circumstances), or otherwise change the value of $COLUMNS (better). I'm gonna check how gnome-terminal and such things handle this. Sorry again Antoine I think I have found the solution, which is to send a TIOCSWINSZ ioctl to the tty. I'm not sure how to do that in elisp, and not sure how portable that will be. Antoine 2008/5/24 Miles Bader : > "Antoine Levitt" writes: > > It's more serious when you take into account the fact > > that some other process (not a shell) might be running at that moment. > > Have you try M-x term instead of M-x shell? It's a different tradeoff, > > but it should be able to accomodate window-size changes. > > > > Me: > > Well, that's the reason why the patch is to shell, not comint. Isn't > shell > > the specialized mode for dealing with shells only ? > > Shells are often running other programs... > > Sending shell commands without an explicit user action is a bad idea, > don't do it. > > -Miles > > -- > `To alcohol! The cause of, and solution to, > all of life's problems' --Homer J. Simpson > ------=_Part_985_30897072.1211666329421 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline And I did it again, sorry. Here is the original message :
A
ww, I can't believe I haven't thought about this earlier. You're right, of course. I'm sorry for not thinking this through
(this problem also occurs with shell-copy-environment-variable, but I don't know how this is used so it may actually not be a problem)
Hmm, so, a solution would be to check for a prompt (there's already a regexp to do just that) and only change columns when there's one on the line (so it also matches prompts with a partially typed command) (bad, might be noticeable under certain (rare) circumstances), or otherwise change the value of $COLUMNS (better). I'm gonna check how gnome-terminal and such things handle this.
Sorry again
Antoine


I think I have found the solution, which is to send a TIOCSWINSZ ioctl to the tty. I'm not sure how to do that in elisp, and not sure how portable that will be.
Antoine
2008/5/24 Miles Bader <miles@gnu.org>:
"Antoine Levitt" <smeuuh@gmail.com> writes:
> It's more serious when you take into account the fact
> that some other process (not a shell) might be running at that moment.
> Have you try M-x term instead of M-x shell?  It's a different tradeoff,
> but it should be able to accomodate window-size changes.
>
> Me:
> Well, that's the reason why the patch is to shell, not comint. Isn't shell
> the specialized mode for dealing with shells only ?

Shells are often running other programs...

Sending shell commands without an explicit user action is a bad idea,
don't do it.

-Miles

--
`To alcohol!  The cause of, and solution to,
 all of life's problems' --Homer J. Simpson

------=_Part_985_30897072.1211666329421--