Opened 10 years ago

Closed 8 years ago

#10687 closed enhancement (fixed)

Add current architecture to PS1

Reported by: puckipedia Owned by: puckipedia
Priority: normal Milestone: R1
Component: - General Version: R1/Development
Keywords: bash, ps1, getarch, bin Cc:
Blocked By: Blocking:
Platform: All

Description

This patch changes two things:

  • It makes setarch add the current arch to the start of PS1 (disableable with the -n (--no-ps1) argument)
  • It changes /etc/profile to add the starting arch to the PS1 (or unknown if getarch isn't available)

It looks like this:

Welcome to the Haiku shell.

[x86_gcc2] ~> setarch x86
[x86] [x86_gcc2] ~> getarch
x86
[x86] [x86_gcc2] ~> setarch x86_gcc2
[x86_gcc2] [x86] [x86_gcc2] ~> exit
exit
[x86] [x86_gcc2] ~> exit
exit
[x86_gcc2] ~> getarch
x86_gcc2

Attachments (2)

0001-setarch-profile-Contain-the-current-arch-in-PS1.-Pro.patch (2.5 KB ) - added by puckipedia 10 years ago.
The patch!
0001-setarch-Inverse-arch-messages.patch (1.1 KB ) - added by puckipedia 10 years ago.
Switch it up! (Apply after the other!)

Download all attachments as: .zip

Change History (8)

comment:1 by puckipedia, 10 years ago

patch: 01

by puckipedia, 10 years ago

Switch it up! (Apply after the other!)

comment:2 by puckipedia, 10 years ago

Okay, I added a patch to switch it up: It is now "Oldest arch left, newest right":

[x86_gcc2] [x86] ~> getarch
x86
[x86_gcc2] [x86] ~> 
Last edited 10 years ago by puckipedia (previous) (diff)

comment:3 by korli, 10 years ago

I think this is only useful when the current selected architecture isn't the default one.

in reply to:  3 ; comment:4 by puckipedia, 10 years ago

Replying to korli:

I think this is only useful when the current selected architecture isn't the default one.

You can just remove the changes made to /etc/profile, will do that in a moment

in reply to:  4 comment:5 by pulkomandy, 8 years ago

Owner: changed from nobody to puckipedia
Status: newassigned

Replying to puckipedia:

will do that in a moment

That is a very long moment! Any plans on finishing this?

comment:6 by pulkomandy, 8 years ago

Resolution: fixed
Status: assignedclosed

Fixed in a different way in hrev50540.

Note: See TracTickets for help on using tickets.