9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Federico Benavento <benavento@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Rc port.
Date: Thu, 24 Jan 2019 13:23:50 -0300	[thread overview]
Message-ID: <58B684D1-BB1D-4598-9B7B-38F945511C4D@gmail.com> (raw)
In-Reply-To: <9FD2C901-6424-40DD-B22B-165C2B0FA46B@gmail.com>

Here, this is what I have.

fn setprompt {
	# delete old function
	fn $ps1
	PWD=`{pwd}
	ps1='['^$sysname^':'^`{basename $PWD}^']%'
	prompt=($ps1^' ' '	')
	fn $ps1 { if(! ~ $#* 0) $* }

	# macOS Terminal Title
	printf '\033]7;%s\007'	file://^`{hostname}^$PWD
}

fn cd {
	builtin cd $* &&
	setprompt
}



> On Jan 23, 2019, at 7:32 PM, Federico Benavento <benavento@gmail.com> wrote:
> 
> Yes, you can, I think I even set the title of the terminal window when I cd. I’m not at home now, i’ll post my rcrc once I get a chance.
> 
>> On 23 Jan 2019, at 19:11, Calvin Morrison <mutantturkey@gmail.com> wrote:
>> 
>> feature i would ove: something equiv to a PS1 line so i know what
>> folder i'm in. Can I do that with $prompt?

—-
Federico G. Benavento
benavento@gmail.com







  reply	other threads:[~2019-01-24 16:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-23 21:39 Federico Benavento
2019-01-23 21:57 ` Calvin Morrison
2019-01-23 21:59   ` Federico Benavento
2019-01-23 22:11     ` Calvin Morrison
2019-01-23 22:32       ` Federico Benavento
2019-01-24 16:23         ` Federico Benavento [this message]
2019-01-24 14:31       ` Stuart Morrow
2019-01-24 16:13         ` erik quanstrom
2019-01-25 15:13           ` Stuart Morrow
2019-01-25 16:02             ` erik quanstrom
2019-01-25 23:11     ` Ethan Gardener
2019-01-26 13:23       ` [9fans] Scripts in 9pm Ethan Gardener
2019-01-26 14:09         ` Ethan Gardener
2019-01-24  3:01 ` [9fans] Rc port Mayuresh Kathe
2019-01-24 16:25   ` Federico Benavento
2019-01-24 16:32     ` Federico Benavento
2019-01-24 16:54       ` Mayuresh Kathe
2019-01-25 14:49     ` Stuart Morrow
2019-01-28 15:22 ` arnold
2019-01-30 16:02   ` Federico Benavento

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58B684D1-BB1D-4598-9B7B-38F945511C4D@gmail.com \
    --to=benavento@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).