Bug 1183733 - Weird "<mock-chroot>sh-4.3#" prompt
Summary: Weird "<mock-chroot>sh-4.3#" prompt
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Clark Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-19 15:59 UTC by Vít Ondruch
Modified: 2017-01-04 11:28 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-01-04 11:28:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1215792 0 unspecified CLOSED mock PROMPT_COMMAND setting causing strange cursor behavior 2021-02-22 00:41:40 UTC

Internal Links: 1215792

Description Vít Ondruch 2015-01-19 15:59:01 UTC
Description of problem:
The prompt is different then it used to be and weird I must say:


$ mock -r ruby22-x86_64 shell
INFO: mock.py version 1.2.4 starting (python version = 2.7.8)...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
Start: chroot init
INFO: LVM plugin enabled. Allocated pool data: None%. Allocated metadata: None%.
INFO: calling preinit hooks
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Finish: chroot init
Start: shell
<mock-chroot>sh-4.3# su - mockbuild
Poslední přihlášení: Po 19.01.2015 16:51:51 CET
-bash-4.3$ 
-bash-4.3$ logout
<mock-chroot>sh-4.3# 
 



Version-Release number of selected component (if applicable):
$ rpm -q mock
mock-1.2.4-1.fc21.noarch


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
There are sh-4.3 and -bash-4.3 prompts.

Expected results:
There are no sh-4.3 and -bash-4.3 prompts. The mockbuild's user prompt should probably contain the <mock-chroot> as well as the root's prompt.

Additional info:

Comment 1 Jaroslav Reznik 2015-03-03 16:44:28 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 2 Fedora End Of Life 2016-07-19 12:41:01 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 3 Vít Ondruch 2016-07-20 10:46:15 UTC
The prompt is still weird ...

Comment 4 Pavel Raiskup 2016-07-21 04:52:20 UTC
Can we close this as DUPLICATE for bug 1215792?

Comment 5 Vít Ondruch 2016-07-21 05:10:51 UTC
(In reply to Pavel Raiskup from comment #4)
Well my concerns were more about the specific format of the prompt, which changed with the mock-1.2.4, so I don't think these are duplicates.

Comment 6 Mikhail Campos 2016-07-21 12:44:40 UTC
What are the real pros of having it re-implemented?

I don't think that mock should care of it at all. This is related to 'user's workflow' inside the buildroot but not to the mock itself (--shell or whatever).

Comment 7 Jan Kurik 2016-07-26 05:12:23 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 8 Sergio Basto 2016-09-27 21:36:12 UTC
I fixed this with add these to /etc/mock/site-defaults.cfg 

config_opts['environment']['PROMPT_COMMAND'] = r'printf "\033]0;<mock-chroot>\007"'
config_opts['environment']['PS1'] = r'<mock-chroot> \s-\v\$ '

or is fixed on mock-1.2.21-1.fc23.noarch , r'something' means one raw string so we don't need double escape \s and \v .

Comment 9 Miroslav Suchý 2017-01-04 11:28:39 UTC
I used r'' syntax in commit
* ccf4d12 simplify PROMPT_COMMAND string

The '\s-\v\' *is* default for bash' PS1. So we just copy here. It is really up to you what you will use there. Thou I added more examples in commit:

* 6839fd5 (HEAD -> devel) more examples of PS1 [RHBZ#1183733]

The only remaining issue is that:
  mock shell
  su - mockbuild
will give you different shell. But that cannot be changed without alternation of bashrc, and I really hesitate to do that.


Note You need to log in before you can comment on or make changes to this bug.