TC passing iInitialCommand to Terminal Emulator possible?

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
gap
Junior Member
Junior Member
Posts: 8
Joined: 2011-08-17, 13:01 UTC

TC passing iInitialCommand to Terminal Emulator possible?

Post by *gap »

Hello,

first of all I'm a big fan! I loved TC for WinMobile and was so happy using it on Android for the first time again!

Now my question: is it possible to set the "intent" "iInitialCommand" via parameters options?
see github[dot]com/jackpal/Android-Terminal-Emulator/wiki/Launching-Android-Terminal-Emulator-from-another-App (sorry can't post links)

I allready tried various variations (using "Start program (main)" or sth. - "Programm starten (Hauptfunktion)" in german):

Code: Select all

extra:iInitialCommand:echo x
extra:iInitialCommand:"echo x"
extra:jackpal.androidterm.iInitialCommand:echo x
extra:jackpal.androidterm.iInitialCommand:"echo x"
and i believe i also tried all of te above with "stream:"

PS: actually I want to set the command to be "cd %P" instead of "echo x" which is just for testing ;)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, unfortunately not - the "extra:" option adds the parameter as "android.intent.extra.name", e.g. "android.intent.extra.iInitialCommand". Currently it's not possible to pass parameters without this name prefix. I will consider it.
Author of Total Commander
https://www.ghisler.com
gap
Junior Member
Junior Member
Posts: 8
Joined: 2011-08-17, 13:01 UTC

Post by *gap »

Hi again, I don't want to be annoying, so if you want just ignore this post ;)

I think
2011-08-19 Added: Button bar, new paremeter "Extra0:": like "Extra", but no prefix "android.intent.extra." is put in front of the name
from the changelog is what you implemented for my needs :) , but I still can't get it to work.
I tried all of the samples from above again. Is it just me?

Thank you again for your great work on TC, Android RC1 is great so far :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Here is the code I'm using:

Code: Select all

if (paramline.startsWith("extra0:")) {
				        		paramline=paramline.substring(7);
				        		int content=paramline.indexOf(':');
				        		if (content>0) {
				        			String xtra=paramline.substring(0,content);
				        			paramline=paramline.substring(content+1);
				        			myIntent.putExtra(xtra,paramline);
				        		}
				        	}


According to your link, you need to use:
extra0:jackpal.androidterm.iInitialCommand:echo x

Then Total Commander will call
myIntent.putExtra("jackpal.androidterm.iInitialCommand","echo x");

However, TC currently only supports parameters for VIEW and SEND, but not for MAIN. You can check whether it works for VIEW (View file with program). If not, I will have to add parameter support for MAIN too. It's very unusual that a program expects parameters in the MAIN action.
Author of Total Commander
https://www.ghisler.com
gap
Junior Member
Junior Member
Posts: 8
Joined: 2011-08-17, 13:01 UTC

Post by *gap »

Hi,

thank you for your reply!
Unfortunately neither VIEW nor SEND does work with the Terminal. It starts and closes again instantly. (Tried with both a selected folder or file)

For the moment I use the internal command 122 to copy the path to the clipboard and insert it after opening the terminal as a workaround.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, I will add parameter support for the MAIN command, although this isn't normally used on Android.
Author of Total Commander
https://www.ghisler.com
User avatar
SkipR
Junior Member
Junior Member
Posts: 69
Joined: 2008-03-27, 10:39 UTC
Location: W. Australia

Post by *SkipR »

gap wrote:Hi,
For the moment I use the internal command 122 to copy the path to the clipboard and insert it after opening the terminal as a workaround.
Thanks for the tip. Is passing args to Term Emulator app still not working?
Skip
Post Reply