Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #16144
| Path | csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail |
|---|---|
| From | "Daniel Colascione" <dancol@dancol.org> |
| Newsgroups | gnu.bash.bug |
| Subject | Re: [PATCH] Add active mark, face support; activate mark on paste |
| Date | Wed, 15 Apr 2020 17:53:40 -0700 |
| Lines | 31 |
| Approved | bug-bash@gnu.org |
| Message-ID | <mailman.365.1586998429.3066.bug-bash@gnu.org> (permalink) |
| References | <M4dFweU--3-2@tutanota.com> <875c423e-0420-78d2-af4b-dfb168432e2d@case.edu> <M4dz8wC--3-2@tutanota.com> <1586997707.1070.15.camel@16bits.net> <05f396dfc106cda1376e53de3e55db4d.squirrel@dancol.org> |
| NNTP-Posting-Host | lists.gnu.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain;charset=iso-8859-1 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | usenet.stanford.edu 1586998429 12465 209.51.188.17 (16 Apr 2020 00:53:49 GMT) |
| X-Complaints-To | action@cs.stanford.edu |
| Cc | bug-bash@gnu.org |
| To | "Ángel" <angel@16bits.net> |
| Envelope-to | bug-bash@gnu.org |
| DKIM-Signature | v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:To:From: Subject:Date:References:In-Reply-To:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6cjyyaSFDqFsyE0BZL+u2j0BE6rBhB5AQBIqI/kuU2s=; b=h3f5H5h7yCiqegnXha1QrpWl4f J+uy7bhSVgqE3m+pGRQCkN1AK+4cEksIpgzF4BWRba9YQIyc9Q0cKdPxheh88DD5KN0RV6Mt0ikmu qk5HRbF0J0IcP8E5xq/jCAIP5q1HNfgbzMb8TfoQt3LjLZJyGSx7BIP7H6DSONiOtH/dpCt9LAHI+ pEpb8lrb4zrXrTPqJnONeEvlYNdZRHyrPimH8+wJP44aHDv8AD37LiaGZiQPY2pKIYncuruE8stuh 1TGXKxlkKNeZkpKd/a3epzspL+9RgqVS5uB9KB0LQSb9OYAtI4xli6XLJ/18hjtB0eWjBVvmBwfMY c3EgB+Qg==; |
| In-Reply-To | <1586997707.1070.15.camel@16bits.net> |
| User-Agent | SquirrelMail/1.4.23 [SVN] |
| X-Priority | 3 (Normal) |
| Importance | Normal |
| X-detected-operating-system | by eggs.gnu.org: Genre and OS details not recognized. |
| X-Received-From | 2600:3c01::f03c:91ff:fedf:adf3 |
| X-BeenThere | bug-bash@gnu.org |
| X-Mailman-Version | 2.1.23 |
| Precedence | list |
| List-Id | Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org> |
| List-Unsubscribe | <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe> |
| List-Archive | <https://lists.gnu.org/archive/html/bug-bash> |
| List-Post | <mailto:bug-bash@gnu.org> |
| List-Help | <mailto:bug-bash-request@gnu.org?subject=help> |
| List-Subscribe | <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <05f396dfc106cda1376e53de3e55db4d.squirrel@dancol.org> |
| X-Mailman-Original-References | <M4dFweU--3-2@tutanota.com> <875c423e-0420-78d2-af4b-dfb168432e2d@case.edu> <M4dz8wC--3-2@tutanota.com> <1586997707.1070.15.camel@16bits.net> |
| Xref | csiph.com gnu.bash.bug:16144 |
Show key headers only | View raw
> On 2020-04-11 at 18:04 +0200, gentoo_eshoes wrote:
>> $ echo ${PS1@A}
>> declare -x PS1=$'\\\n-----------\\n\\\n\\[\\a\\]\\\n\\[\\e[1;37m\
>> \e[42m\\]\\u@\\H\\[\\e[0m\\] \\\n\\[\\033[1;30m\\]$(date "+%Y/%m/%d %
>> H:%M:%S")\\[\\033[0m\\] \\\n\\[\\e[0;37m\\]\\s\\V t:\\l j:\\j \\\nd:
>> ${SHLVL} pp:${PPID} p:$$ ut`cat /proc/uptime | cut -f1 -d.`\\[\\e[0m\
>> \]\\n\\\n\\[\\e[0;37m\\]!\\!\\[\\e[0m\\] \\\n\\[\\033[0;36m\\]\\#\\[\
>> \033[0m\\] \\\n$(evalexitcode "${__earlyec[@]}" ) \\\n\\[\\e[0m\
>> \]$(uname -r) $(uname -v)\n$(ps_lepath "\\w")\\[ \\033];\\w\\a\\]\n\
>> \[\\e[1;32m\\]\\$\\[\\e[0m\\] \\\n'
>
>
> That was an… 'interesting' prompt.
>
> Note that there are several subprocesses that you could easily avoid:
>
> $(date "+%Y/%m/%d %H:%M:%S") is equivalent to \D{%Y/%m/%d %H:%M:%S}
>
>
> `cat /proc/uptime | cut -f1 -d.` this could be simplified to `cut -f1 -d.
> /proc/uptime`
> it may be replaced with just builtins by `uptime=$(</proc/uptime); builtin
> echo ${uptime/.*}`
>
> $(uname -r) $(uname -v) is equivalent to $(uname -r -v) I wonder why you
> need these fairly static values on every prompt line, though.
More generally, a loadable module command can do whatever you want, and
that's going to be more efficient than any subprocess fork and exec.
Back to gnu.bash.bug | Previous | Next | Find similar
Re: [PATCH] Add active mark, face support; activate mark on paste "Daniel Colascione" <dancol@dancol.org> - 2020-04-15 17:53 -0700
csiph-web