Repository: xonsh/xonsh

Issue:
Reinventing the prompt end character for xonsh
Hi folks! 

Prerequisites:
1. While I'm watching [@scopatz streams](https://www.youtube.com/watch?v=dGTkiGvrYHg) I noticed that [xonsh looks like bash](https://youtu.be/EbX2fhfwOWc?t=832) and if we don't know that it's the xonsh we will never understand that it is xonsh. 
2. When I alternately use Bash and Xonsh I caught myself thinking that I am making an effort to figure out which shell I am currently using.
3. When I'm reading the bug reports in the issues or another code quotations the `$` character means bash as well as xonsh and I need to special effort to understand the meaning.
4. The bash-like prompt looks cozy but after a few rakes with the syntax users feel misled. The conch character will remind them that here is Python mindset.
5. We have double dollar in case of using env: `user@home ~ $ $VAR=1`. The conch character will dilute the repetition.
6. The conch character (`@`) in the prompt will complete the xonsh identity. We can remove or replace this character between user and host to more significant effect.
7. The `@` character looks both like conch and python (snake).
8. Using `$` limit the spreading the word about xonsh and growing the community because people think that it's bash.
9. By using `@` we can separate `$` for bash and `@` for xonsh.
10. The `@` character with `~` looks like "snail (snake, python) going to conch (shell)" - very very very metaphoric - `host@user ~ @`.


Overview:
```bash
# xonsh default 
user@host /path $

# bash default
user@host:/path$

# zsh has percent by default
user@host /path %  

# fish wants to look like fish
user@host /path>

# Starship cross-shell prompt (bold angle bracket)
❯

# proposed for xonsh
user@host /path @
```

**What if we replace `$` to `@` and make/replace a space between user and host in xonsh?** 

![image](https://user-images.githubusercontent.com/1708680/110364234-9330f700-8054-11eb-8d91-1afe1905754a.png)

![image](https://user-images.githubusercontent.com/1708680/110359210-42b69b00-804e-11eb-97bf-a4d1113a5335.png)

This looks like snail and conch:

![image](https://user-images.githubusercontent.com/1708680/110358956-f79c8800-804d-11eb-91a3-0e06f1e3c0ac.png)

[xontrib-prompt-bar](https://github.com/anki-code/xontrib-prompt-bar) appearance:

![image](https://user-images.githubusercontent.com/1708680/178773604-b2f9954a-6ecc-427d-adad-7401cff2b184.png)

### 📄 [XEP-like description](https://github.com/xonsh/xonsh/issues/4152#issuecomment-794875983)

# 📗 VOTE HERE - https://github.com/xonsh/xonsh/issues/4152#issuecomment-794178842

## For community
⬇️  **Please click the 👍 reaction instead of leaving a `+1` or 👍  comment**



Discussion:
1. I replaced `$` to `@` in [xontrib-prompt-bar](https://github.com/anki-code/xontrib-prompt-bar) and it looks nice:

    ![image](https://user-images.githubusercontent.com/1708680/110252131-f9564500-7f94-11eb-8627-ada7a67b1f8f.png)

2. I've added [recommendation to the xontrib-prompt-starship](https://github.com/anki-code/xontrib-prompt-starship#recommendation) and it also looks nice:

    ![image](https://user-images.githubusercontent.com/1708680/110287805-2851d280-7ff8-11eb-81a3-8d531e15ecbd.png)

3. [Also Jamie and Gil replaced](https://github.com/xonsh/xonsh/issues/4011#issue-761655392) `$` to 🐚 icon in personal settings far far ago. Example:

    ![image](https://user-images.githubusercontent.com/1708680/110337158-a92fbf00-8036-11eb-8787-3886e50cc926.png)



For anybody who agree and use default prompt I suggest to add this to the `~/.xonshrc` now:
```python
$PROMPT_FIELDS['prompt_end'] = $PROMPT_FIELDS['prompt_end'].replace('$', '{WHITE}@') # '🐚'
```
Seems like a reasonable default to me.  I use 🐚 as my `prompt_end`.
I'll wait a bit to see if anyone has any concerns about this, then we can go ahead and merge in #4155
IMHO `@` doesn't seems to be the end of prompt. What do you think about `❯` (from [pure](https://github.com/sindresorhus/pure) prompt). It is a special symbol(probably would required utf-8 support from the terminal) but it looks modern and proper start for the commands to be entered. 

I think ">" is used so commonly (fish, Starship, pure, powerline) that will be the same as $ soon. In other side @ could be the part of xonsh individuality/identity.
It is just `@` doesn't click as the end of prompt. Maybe it is because we use it a lot in emails and expect it to be in the middle and not at the end.
Also, @ is part of language, when copy pasting, it can cause confusion to newcomers. I know about $, since we are asking for a new one, can't we have a better one that doesn't clash with the language.
I don't realize what will confusion newcomers? You mean they will copy all the string including @? I think they will do it once and understand.
yes they may copy it as whole or will read the content and it may confuse when first seeing the code snippet

for example something like this
```
~@ @('ls')
```
. Regarding colors, it needs pygments. 
> ~@ @('ls')

How it looks:

![image](https://user-images.githubusercontent.com/1708680/110359354-74c7fd00-804e-11eb-9d0e-32422f15b693.png)

The use case above is rare than this:

```
user@host ~ $ $ENV=1
```
> > ~@ @('ls')
> 
> ![image](https://user-images.githubusercontent.com/1708680/110359354-74c7fd00-804e-11eb-9d0e-32422f15b693.png)
> 
> The use case above is rare than this:
> 
> ```
> user@host ~ $ $ENV=1
> ```

yes that is what I was saying, we have the oppertunity to have something new. So we can avoid similar mistakes.
> What do you think about `❯`

I think it looks cool but I don't want the default to require utf-8 encoding (just because it can sometimes be a pain to get configured correctly).

We could make the default `>` -- which doesn't have the lovely shell evolution scheme that @anki-code introduced above, but would avoid the copy-paste collisions for both `$` and `@` operators
can we detect the support and choose it dynamically between `❯` and `>`. Also most of the new age shells use `>` as default like nushell, elvlish ...
The concept behind @ is to accent the xonsh identity and identify the xonsh on any screenshot/video stream. I'm personally indifferent to ">" because it has wide usage and suppose xonsh will look as fish :)

If you see many issues around @ I prefer close this issue without any negative emotions because the world is really complex. May be the better way is: to add the choice to the xonfig wizard and add `prompt_end_conch` to PROMPT_FIELDS and recommend it in docs.

I'll be happy to hear @scopatz oppinion because from his video streams I started this issue :)
Yes it is better to be unique but should not look weird. Lets hear out more people's opinion. 
I kinda like this idea!
- Sure it can look like the `@()` token but that will happen with just about any ASCII character (and it already happens with `$`).
- I think adding a recognizable small change like this adds some nice spark to xonsh users.

Since this is really a stylistic thing, maybe we should have some sort of vote? 
Yes, I too think polling is the way to decide it. Since it is about perception on the whole.
Ok -- let's hold a vote, open to all. React with:  
* 👍 if you want to change the default `prompt_end` to `@`
* 👎 if you prefer something else.

@xonsh/xore @xonsh/xore-emeritus @xonsh/xonsh-triage 
And if someone can post a link to this on Gitter, I'd appreciate it (blocked on `$WORK_LAPTOP`)

We'll give it until EOD on Friday 2021-03-12, AoE (https://en.wikipedia.org/wiki/Anywhere_on_Earth)
> Ok -- let's hold a vote, open to all. React with  if you want to change the default `prompt_end` to `@`,  if you prefer something else.
> 
> @xonsh/xore @xonsh/xore-emeritus @xonsh/xonsh-triage
> And if someone can post a link to this on Gitter, I'd appreciate it (blocked on `$WORK_LAPTOP`)
> 
> We'll give it until EOD on Friday 2021-03-12, AoE (https://en.wikipedia.org/wiki/Anywhere_on_Earth)

can we consider, holding for 
1. `@`
2.  `>`
3.  `❯` if character code is printable/available otherwise `>` 
4. other characters (open to people's suggestion) 

we can have a comment for each of this options and people can thumps up on it. for the 4th, one can quote and comment their new symbol ?
I'd like to stick with an up/down vote on `@` for now, since this is a bit ad-hoc already, then if the consensus is "something else" we can put together a more formal poll.

https://xkcd.com/1172/

> I'd like to stick with an up/down vote on `@` for now, since this is a bit ad-hoc already, then if the consensus is "something else" we can put together a more formal poll.
> 
> https://xkcd.com/1172/

Ok.

🤷 is not a voting option :-) I'm not for, but not against either. It's configurable anyway; so why not changing.
## XEP-like description

To clear understanding what the complete changes list were suggested:
1. Replace prompt_end character from $ to @.
2. The @ character will be white/lightgrey color to associate with classic xonsh conch.
3. The @ between user and host will be removed.
4. (Optionally/Future) The xonfig wizard will have an option to set the classic bash prompt.

As result this make xonsh identity, increase xonsh visibility and reduce associations and unjustified expectations from xonsh as sh-shell.

How it looks:

![image](https://user-images.githubusercontent.com/1708680/110577146-19dbf600-8173-11eb-9447-5da7a3e6aefa.png)

![image](https://user-images.githubusercontent.com/1708680/117588853-df6ce600-b12e-11eb-8559-07dd51e94403.png)

This look has many meanings:
1. The @ char remember that it's xonsh.
2. The @ char point out to both conch and Python.
3. In the home directory "~ @" looks like snail with conch.
4. The space between user and host make the line clean.

Potential issues:
1. If we will use @ in the quotation (`@ echo 1`) the @ char may not be read as the prompt start by novices. 
Workaround: we will use color  accent.
2. If we will use @ in the quotation (`@ echo 1`) the code highlighters may not to highlight the commands properly. 
Workaround: no.
3. The @ char will have visual duplication in case `@ @('ls')` as `$ $VAR=1` in the current prompt. 
Our acceptance logic for this based on that the first case is rare than second.
4. Someone could find the @ char as unusual/differ/uncomfortable. 
Our logic of acceptance for this is "just simply change PROMPT to comfortable". For example default zsh prompt looks like `host%` and nobody complains and just use custom prompts.
Not a fan of using @ as the prompt end character.  It's an overloaded and used character in so many places and it's used as a specific feature even in xonsh, this would lead to confusion, which leads to frustration, which leads to hate, which leads to the dark side.  
@hemna please put your voice by clicking the emoji here - https://github.com/xonsh/xonsh/issues/4152#issuecomment-794178842
> 🤷 is not a voting option :-) I'm not for, but not against either. It's configurable anyway; so why not changing.

@Carreau In this case please set the 👀 reaction on https://github.com/xonsh/xonsh/issues/4152#issuecomment-794178842 ;)
It is configurable, so the default choice seems to very important for me. But, I think for new users it can be very uncomfortable. The best option for me is to add a choice of prompt in xonfig wizard, but keep the actual prompt in default choice (it is why I choose :-1:, but this choice is "something else", and I had to explain the sub-choice).
Good discussion, but I’m not convinced about a single @ symbol. As said before by others, it is not associated with waiting for a prompt and too often used in emails. I  *could* live with something like  `@>`.
> associated with waiting for a prompt

Nice question - [What is the origin of the UNIX $ (dollar) prompt?](https://superuser.com/questions/57575/what-is-the-origin-of-the-unix-dollar-prompt). Some answers:

* The culmination of your login efforts is a percent sign “%”. The percent sign means that UNIX is ready to accept commands from the terminal.

* The original Bourne shell prompt was a snail shell, "@". I remember this on UNIX 6th edition which, I believe, is before UNIX was sold commercially. So the switch to a $ sign could be related to commercialisation of UNIX, as Robert suggested, $hell.

* By contrast the traditional C shell prompt is a percent sign (%). 

Nowadays `>_` is to refer the any terminal and the `$_` is to refer mostly linux terminal or sh-compatible shell.

This all tell that "association of waiting for a prompt" is a personal feeling that just depends on habit of the first/most frequent shell prompt before.
> https://xkcd.com/1172/

Uuuuuuuuuh, soooo funny - soooooo true!

Thanks you all for the attention to this issue :)

I'm going to close this issue.

Personally I will praise and recommend to set `@` as prompt_end in [prompt_bar](https://github.com/anki-code/xontrib-prompt-bar) and [prompt_starship](https://github.com/anki-code/xontrib-prompt-starship).

The results for the history:

<details>

![image](https://user-images.githubusercontent.com/1708680/110975655-11e9a500-8371-11eb-8ca6-2d8f3bea39e3.png)

</details>

Resolving patch:
diff --git a/xonsh/prompt/base.py b/xonsh/prompt/base.py
--- a/xonsh/prompt/base.py
+++ b/xonsh/prompt/base.py
@@ -340,7 +340,7 @@ def load_initial(self):
                 user=xp.os_environ.get(
                     "USERNAME" if xp.ON_WINDOWS else "USER", "<user>"
                 ),
-                prompt_end="#" if xt.is_superuser() else "$",
+                prompt_end="#" if xt.is_superuser() else "@",
                 hostname=socket.gethostname().split(".", 1)[0],
                 cwd=_dynamically_collapsed_pwd,
                 cwd_dir=lambda: os.path.join(os.path.dirname(_replace_home_cwd()), ""),


Test patch: