Show Current Working Directory in Prompt?
Is there a way to show the working directory in the Prompt?
E.g.
~ $
/Library/bin $
Potentially able to only show the directories within the application ID 😁
This feature is not available for the time being. It is on the TODO list, but there are issues to consider. Ideally, I'd like to use a syntax that people are familiar with, and at the same time I'd like the default behaviour to produce something useable.
Directories in iOS tend to be quite long, and displays can be quite small.
just type pwd to show your current path
This feature is not available for the time being. It is on the TODO list, but there are issues to consider. Ideally, I'd like to use a syntax that people are familiar with, and at the same time I'd like the default behaviour to produce something useable.
Directories in iOS tend to be quite long, and displays can be quite small.
As an intermediate step, perhaps you could offer a way to change the color of the $ prompt? It will help a great deal for scrolling through pages of text with intermingled input and output.
This feature is not available for the time being. It is on the TODO list, but there are issues to consider. Ideally, I'd like to use a syntax that people are familiar with, and at the same time I'd like the default behaviour to produce something useable.
Directories in iOS tend to be quite long, and displays can be quite small.
@holzschu I noticed that v1.9.0 now allows prompt customization. But I am having a hard time figuring out the syntax. Could you please give some examples?
It follows the bash syntax: \w for current directory with path (but shortened using ~ as much as possible), \W for current directory, \t for the time... This page (any others) have the list of commands: https://www.howtogeek.com/307701/how-to-customize-and-colorize-your-bash-prompt/
All of this goes into the PS1 environment variable.
I was able to follow these instructions on another Ubuntu virtual machine, but not on a-Shell. This is what I am getting:
[~/Documents]$ PS1="\u:\w\$ "
PS1="u:w$: command not found
[~/Documents]$ export PS1="\u:\w\$ "
"u:w$
Try with setenv PS1 "\u:\w$ "
export is not behaving as expected, but export PS1=\\u:\\w$ will give you what you want (i.e. no double quotes). I'll have a look at why export does not do what it should do.
I can confirm setenv works both in the command line and in a .profile. Thanks.
@holzschu While we are at this, I would like to alert you of a small bug on the iPhone. When I start a-Shell, I get $ $ as the prompt. A simple return will yield the prompt I have customized for. The iPad version does not have this issue.
$ $
[~/Documents] $
Version 1.9.1 is now out, it should fix this issue with export.
@holzschu While we are at this, I would like to alert you of a small bug on the iPhone. When I start a-Shell, I get
$ $as the prompt. A simple return will yield the prompt I have customized for. The iPad version does not have this issue.$ $ [~/Documents] $
A reinstallation of A-Shell got rid of the $ $. Now the iPhone prompt behaves the same way as the iPad Prompt.
I suspect this was a-Shell restoring the content of a previous session.
The $ $ crept back again with some usage after the fresh installation.