delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/01/22/10:28:06

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4968398EC14
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1611329242;
bh=7jemM/Knf60OP+HyMyKVcbJ9/eb2KZ4kReip066Bgak=;
h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=oqLy95zS49vEq5sYok9zpArbqjv3kLPE3vCHlXSdBKeiYR3cF9paAVxSvVPtlpgDZ
1FtxvrEVN+XGCyBQj7eXK8AGIgMdT1OBwqcvZwxVzkkoITz050mCTJc8gE39mFEFnl
C0FhOKiQlbuuu2tE6BsgGOhhNlXv+rPrW6C3yuXU=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AABC4398E44C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=cHVWxDtlDtdaym0tLCKbU79ec04i+SPNvHymwaFVjZkA3h91wiBSuidRNLdBU00ET3lbXmiTafmFqRx6drtOoxhNyUf9XslFp3i1olQQb5Yh6LMMn8vqO+G42qYSixjYYOtaJL3uG1EoaaTVt/kc8c5MY7p6nNOcgDdVhmdaXzOcs0qp8CPi3qlf4bQ1lf0z5LOpY4l8g48jrb2byFccXgjcp3fE8pH+0zD462842sto9heAP401S3C5KbB+5iPvDtAyZD246+MiDRB1RF1nb1SQEizVCFYQ1B9y+AGX93vBzirGPXn9nUgFZawerkD58x4BUrtGtUWm4nF64oiZfA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=WRRG/r1MNppzcbc3BCGrRdHlxnKz2ydoQlxf5N9bP4E=;
b=KD35UGv5bYZRzOHZQI/whaM0yvFmzXoZZjgWR5ptL5tHcpEmsqtJq9siNEAiXLaIJLKBcgC66wAQAdBPnOq9CdIsiglFVXyeXRO7T1QhOgUju8yE0MIiiRGvMBFeLQ3LPjzmgaVz3q6iqTK2Al2D/uTgAeZ2vXHcj74o6bW0c0gQLceh8bMwh0gVmqSJvhjq9saOrNC5fRI4h+PwKcQXFwDMZCdqh7UMwcB/Yujk+jH5us33k/cznHhOfEtOnagYZq2nTCXGei5ZJmhslYzvP2qCLTjZz64NHgU5eNhxDuns8afQ9DQN2pTDVyOB2L7cPoOMTAOUA+vod+QdyRPxJg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu;
dkim=pass header.d=cornell.edu; arc=none
Subject: Re: Terminal output disappearing after SSH into cygwin
To: cygwin AT cygwin DOT com
References: <644c7c45-b1a5-8c9f-8d6d-70b99a06c378 AT stefanist DOT com>
<d1aee930-43e0-e405-c094-2a4545ca09b5 AT gmail DOT com>
<9072877f-c67d-5767-7a58-274abecfecbf AT stefanist DOT com>
<190171158 DOT 2668557 DOT 1611244936009 AT mail DOT yahoo DOT com>
<9a0ce80d-fcdb-9f07-788c-c157a2de8535 AT SystematicSw DOT ab DOT ca>
Message-ID: <adf953c8-778b-a5ea-3701-041688811a0d@cornell.edu>
Date: Fri, 22 Jan 2021 10:27:15 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.6.1
In-Reply-To: <9a0ce80d-fcdb-9f07-788c-c157a2de8535@SystematicSw.ab.ca>
X-Originating-IP: [65.112.130.200]
X-ClientProxiedBy: BN6PR12CA0041.namprd12.prod.outlook.com
(2603:10b6:405:70::27) To BN7PR04MB4388.namprd04.prod.outlook.com
(2603:10b6:406:f8::19)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: e3f0b2c3-ea55-44f3-38e3-08d8beea33df
X-MS-TrafficTypeDiagnostic: BN8PR04MB6386:
X-Microsoft-Antispam-PRVS: <BN8PR04MB63862EA6B5231D49E33ED65AD8A09 AT BN8PR04MB6386 DOT namprd04 DOT prod DOT outlook DOT com>
X-MS-Oob-TLC-OOBClassifiers: OLM:8882;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: ufYzFZNdKK5/RZVrOdfgO4rD/pB/zoabKghTAiVe9wzUDpxWam9OrsvsHFBtSyb5bvc7/uDQlg2UxHLJgh0+wQBecV/LinT+M0q9BVeIXW2F639hMvlkNX4DYBu7zW5OToYTEvhbkisK7kQIfwtIL4xDZ2iy7Y93Hod6YuqOGXD6FsIlOtmzVl/exAgFtInfLvkbpFdTyZ/bm1APOCcCiL/ZFNXxv/V3a1m1v+P49ta6s+H4mmpP5rY7K40pN1J8A1dY+JNBbVJecN3lWomLjk2UMp90iEo3XiUBlT8Ed/Gxkj1F3E+yCx10mjNf2/3nGuE1L0aLA6I1QdMgBUa1DlKAN0IqrSx3xSmniH3VN0Es/7UVnLOfnECpoJAvefaWrd/4WJ2YMYnPWyaCDPHQ0zmLGmC9RHJkFfEDauv+s57EiPbwuZdNwyr2ounv4hhFzPFHeHQlL2CFq33qbZZspCDmafZNt4UVArEh0vBgQkg=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:BN7PR04MB4388.namprd04.prod.outlook.com; PTR:; CAT:NONE;
SFS:(4636009)(39860400002)(366004)(136003)(346002)(376002)(396003)(16576012)(6486002)(53546011)(2616005)(36756003)(956004)(2906002)(16526019)(316002)(26005)(75432002)(5660300002)(8936002)(8676002)(786003)(186003)(83380400001)(478600001)(4326008)(52116002)(86362001)(31686004)(66556008)(66946007)(31696002)(6916009)(66476007)(45980500001)(43740500002);
DIR:OUT; SFP:1102;
X-MS-Exchange-AntiSpam-MessageData: =?Windows-1252?Q?6CeHtGK/Pfjvg8PFswrtwc7yFsVPefTX427sNKRqzxMuouTdj/Naidwe?=
=?Windows-1252?Q?K8OVjfOwEoc9929LUHMC6KSt9HKdtC57Wr2vpC80GubcJqjGU3701Iiz?=
=?Windows-1252?Q?pHLT0AZIZ1P/aleH1kyDdQxp/x6pqNUwWDFmgzDVtUrjj6s02mVTksnX?=
=?Windows-1252?Q?XjgLFwAhnLCfz774Uv8N5i0mOtvR38Z2Eckv0N7+R/biale297uOP87N?=
=?Windows-1252?Q?cGbz+Wycdqo5zi0NHUJiqdW+k/zYtR/AkCaffcz66cIvRTYvANTAzd4H?=
=?Windows-1252?Q?DkJW39/8MFVGk3xlXxL+tYzIGeAs9Yn3dBXkI47OTbHHOg3+mBwgrera?=
=?Windows-1252?Q?ZnyHHrNYUizflBo6MnkNMLeksDkaeuNuKKb3+Il0giW777w+66/iMAEl?=
=?Windows-1252?Q?yRv7+mwxfYVH9wGaIjKigZ9RB6O5qPwqgu/PWY5HIeAcseB+oddA7we3?=
=?Windows-1252?Q?KbXzAMX5splMJAbW7Ic2ohMSq0JAujNr0QU40mjsnNG0o/eISNfOxp9f?=
=?Windows-1252?Q?qaBq6Ual0LaNezZA9JlrqgYx53zHoVJKAUMzZVOcBe1sqe636G9nLN+E?=
=?Windows-1252?Q?Qps12oUMua3P9+BKA4w9EkRtkUBZxemLzEkVeACYnaWPbIOJKMFnRB9V?=
=?Windows-1252?Q?ntdIdiWJ55ZsddznUkvOkvwNC6GQXYHsS2l3zUE2UB9ItHFCbZ4XcUDy?=
=?Windows-1252?Q?sMbTL6iTGVsvAYGpDX0RdyzNBZHWQ7GREWV+fwTjSD/jdRuLXYvH1SLu?=
=?Windows-1252?Q?am6BgdFzhkPX4TlUi6GrUMRTH3JtL05L6xY42Vllj2j36T/2YsNA126N?=
=?Windows-1252?Q?bh47XAZqn3QGo4cKZnmpqJhmvjG404/NXoDn3S/JT5DCKg5NmVY70mmF?=
=?Windows-1252?Q?kFb1HrOOXwBRv0gnQZJJhf3LyeDqRcYzCjCTCnxF6K5OcO8bRP0bWtPq?=
=?Windows-1252?Q?uTjnaEYyIUmdXJWKF2seiSo7jSH9mj/cbZEgVJJo2OTouSvTXLVU+L3R?=
=?Windows-1252?Q?K1Q+aHYnQ4OaQHifVocaIejBTdlBZ341bL1V6SBKX5sT+xD88q6fWMKK?=
=?Windows-1252?Q?6QP4tiL/pb8e1HwE?=
X-OriginatorOrg: cornell.edu
X-MS-Exchange-CrossTenant-Network-Message-Id: e3f0b2c3-ea55-44f3-38e3-08d8beea33df
X-MS-Exchange-CrossTenant-AuthSource: BN7PR04MB4388.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2021 15:27:17.7595 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: p6j7HysM6TS5apae3VetUxylHGaimuUJt3aHvqhzbdYYBhhv5yM4vVD3xwCt8YaEm9Ykf0J2yGD4PpZXQdUqnA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR04MB6386
X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_INVALID,
DKIM_SIGNED, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, NICE_REPLY_A,
SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Ken Brown via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Ken Brown <kbrown AT cornell DOT edu>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 10MFRlvp005354

On 1/22/2021 3:16 AM, Brian Inglis wrote:
> On 2021-01-21 09:02, matthew patton via Cygwin wrote:
>> On Thursday, January 21, 2021, 10:49:14 AM EST, Martyn B wrote:
>>> On 2021-01-21 11:13, Ken Brown via Cygwin wrote:
>>>> There's also /etc/bash.bash_logout.  The default version of that clears the 
>>>> screen:
>>>>
>>>> $ cat /etc/defaults/etc/bash.bash_logout
>>>> [...]
>>>> # base-files version 4.3-2
>>>>
>>>> # /etc/bash.bash_logout: executed by bash(1) when login shell exits.
>>>>
>>>> # The latest version as installed by the Cygwin Setup program can
>>>> # always be found at /etc/defaults/etc/bash.bash_logout
>>>>
>>>> # Modifying /etc/bash.bash_logout directly will prevent
>>>> # setup from updating it.
>>>>
>>>> # System-wide bashrc file
>>>>
>>>> # when leaving the console clear the screen to increase privacy
>>>> if [ "$SHLVL" = 1 ]; then
>>>>    [ -x /usr/bin/clear ] && /usr/bin/clear
>>>> fi
> 
>>> 1) understand why this happens. - Is this the Cygwin standard behavior?
> 
>> Not in the slightest.
> 
> It appears to be so:
> 
> $ cygcheck -f /etc/defaults/etc/bash.bash_logout
> base-files-4.3-2
> $ ls /etc/**/*bash_logout
> /etc/bash.bash_logout  /etc/defaults/etc/bash.bash_logout
> $ zgrep bash_logout /etc/**/base-files*
> /etc/preremove/base-files-manifest.lst:etc/bash.bash_logout
> /etc/setup/base-files.lst.gz:etc/defaults/etc/bash.bash_logout
> 
> Whether it should be is a good question.
> 
> There's no /etc/bash_logout file under Debian, etc. but /etc/skel/.bash_logout 
> and ~/.bash_logout also have the same clear screen code.
> 
> Is (or was) /etc/bash.bash_logout that did this in the bash sources or under 
> Fedora, which is the Linux basis for some Cygwin approaches, behaviour, and 
> conventions?

There are two separate issues here.  The first is that Cygwin's bash executes 
/etc/bash.bash_logout.  The second is that the default /etc/bash.bash_logout 
clears the screen.

The first issue is dealt with in the bash sources.  It is an option that is 
disabled by default, but Cygwin's bash maintainer chose to enable it.  That's 
done in the following hunk from bash-4.4.12-3.src.patch:

--- origsrc/bash-4.4/config-top.h	2016-05-19 13:34:02.000000000 -0500
+++ src/bash-4.4/config-top.h	2017-01-27 13:11:50.793821100 -0600
@@ -87,10 +87,10 @@
  #define DEFAULT_BASHRC "~/.bashrc"

  /* System-wide .bashrc file for interactive shells. */
-/* #define SYS_BASHRC "/etc/bash.bashrc" */
+#define SYS_BASHRC "/etc/bash.bashrc"

  /* System-wide .bash_logout for login shells. */
-/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
+#define SYS_BASH_LOGOUT "/etc/bash.bash_logout"

  /* Define this to make non-interactive shells begun with argv[0][0] == '-'
     run the startup files when not in posix mode. */

I've added Eric to the CC in case he wants to comment.

I don't know the history of the second issue, but that's a matter for Achim as 
base-files maintainer.

Ken
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019