a-shell icon indicating copy to clipboard operation
a-shell copied to clipboard

.profile: echo not working

Open SimpelMe opened this issue 2 years ago • 6 comments

Hi.

I want to print some hints every time a-Shell starts e.g. „>> hint: ESC = CMD + . — needed for vim“. So I wrote those hints into profile. echo " >> hint: ESC = CMD + . — needed for vim" But that isn‘t working. Any hint for me to print out custom hints after startup?

Regards, Simpel

SimpelMe avatar Mar 14 '22 02:03 SimpelMe

It's a good question. The .profile is executed before the standard output is active, so there is basically nothing to write to. I could redirect writing to a temporary buffer, and output this buffer once the window exists. I'll have to think about it.

I'm a bit worried about the content of your tip, though: there are ways to remap different keys to get "Escape" (both in the App settings and in the system keyboard settings).

holzschu avatar Mar 14 '22 06:03 holzschu

In OSX I could use .shrc as this is executed after standard out is active. Maybe a .shrc could be executed if existing and cli is ready?

My “Escape” tip prints the default as I entered vim with iPad and then scared recognized no exit. I had to google it and found that default. I’m not aware of remapping keys on iOS and don’t consider to do that.

SimpelMe avatar Mar 14 '22 08:03 SimpelMe

You have the simple option: open the Settings app, go down to a-Shell, and click “Caps-Lock = Escape”. This one will map caps-lock to escape on your external keyboard to escape, but only for a-Shell.

The more complicated option: open the Settings app, go to General, Keyboard, Hardware Keyboard and remap the keys: https://apple.stackexchange.com/questions/199920/how-to-change-the-keymap-of-a-bluetooth-keyboard-of-ipad#391111

Also, the leftmost button on the button bar at the bottom of the screen is Escape.

holzschu avatar Mar 14 '22 09:03 holzschu

Now I know what this button is. Thank you.

But you mean the third one is escape I guess. From left to right on the left side they are tab, ctrl and esc I think.

I wish those buttons where mentioned in the „help“. Thanks anyway. Great tool.

SimpelMe avatar Mar 14 '22 09:03 SimpelMe

You can also add something like this to your .profile:

jsi -wc "alert('Content of message here!')"

This displays a graphical alert dialog with 'Content of message here!' every time you start a-Shell.

jsi interprets JavaScript (and alert dialogs don't need access to I/O).

The -w flag is short for --in-window, which tells a-Shell to run things in the same WebView as the terminal GUI. The -c flag means to run whatever comes right after it.

Thanks @personalizedrefrigerator. It's a bit invasive as I have to hit "OK" every time I open up a new window but it works. I will use it until I'm hacked off popups.

SimpelMe avatar Mar 15 '22 09:03 SimpelMe