TobiasChe / conemu-maximus5

Automatically exported from code.google.com/p/conemu-maximus5
0 stars 0 forks source link

Bookmarks menu #829

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Required information!
OS version: Win2k/WinXP/Vista/Win7/Win8   SP?   x86/x64
ConEmu version: 121125 x64

Navigating to certain folders can be a pain especially in case of multiple 
levels of hierarchy even with tab based autocomplete. One way to improve 
usability is to consider adding a bookmarks menu and add/navigate to the 
current path. 

Konsole on KDE does this and a similar feature for ConEmu would add to its 
awesomeness.

Original issue reported on code.google.com by md.i...@gmail.com on 26 Nov 2012 at 6:11

GoogleCodeExporter commented 9 years ago
Hm... Konsole is a shell *and* terminal. ConEmu is terminal only.

In the other words, ConEmu can't know how to navigate shell to specified 
location. However, thought, is is possible to create menu for 
folders/files/anything else.

Btw, did you try Ctrl+Shift+D / Ctrl+Shift+F shortcuts?

Original comment by ConEmu.Maximus5 on 26 Nov 2012 at 6:38

GoogleCodeExporter commented 9 years ago
Thanks for the explanation. 

Ctrl+Shift+{D,F} both still require me to navigate to the folder every time so 
it's not that useful in this case.

I understand it might not be possible to read the path from the shell, but the 
other way round should be possible I hope. What I mean to say one should be 
able to select file/folder from the menu (configurable via the GUI like in 
browsers) and the path should then be pasted on the shell similar to what 
Ctrl+Shift+{D,F} does.

Original comment by md.i...@gmail.com on 26 Nov 2012 at 6:46

GoogleCodeExporter commented 9 years ago
Konsole is NOT a shell - bash/dash/zsh etc. are shells which can be launched 
under Konsole, or any other executable. Konsole is in the same position as 
ConEmu.

Konsole simply sends a keystroke sequence, in the form of "cd 
/absolute/path/to/bookmark". This feature is fragile, as it only works when the 
prompt is empty and in the normal state (e.g. it won't work if you type 
something first, or if you press Ctrl+R).

Original comment by thecybershadow on 30 Nov 2012 at 7:21

GoogleCodeExporter commented 9 years ago
OK, at the same level feature may be implemented.
However, there is one more problem: on Windows there are many path notations :)
cmd: cd /d "c:\full\path"
tcc: cdd "c:\full\path"
ps: cd "c:\full\path"
mingw-bash: cd /c/full/path
cygwin: cd /cygdrive/c/full/path

grrr...
may be we need to "bookmark" not "paths" but commands?

Original comment by ConEmu.Maximus5 on 30 Nov 2012 at 7:32

GoogleCodeExporter commented 9 years ago
Suggestion:

This feature will only work in a specific shell (e.g. cmd.exe). Even if only 
the CMD variant is implemented, ConEmu would need to check if the current 
process is cmd.exe before allowing the user to send keystrokes to arbitrary 
applications (e.g. attempting to use the feature with a program such as vim may 
be catastrophic). Thus, the feature can be implemented by looking at the name 
of the top-level executable, and choosing an appropriate syntax based on that.

Original comment by thecybershadow on 30 Nov 2012 at 10:49

GoogleCodeExporter commented 9 years ago
Suggestion #2: Allow the user to "favorite" macros? Then, the cd command can be 
created as a "Paste" macro.

Original comment by thecybershadow on 30 Nov 2012 at 10:52

GoogleCodeExporter commented 9 years ago
I've found a nice workaround to use the print command in order to navigate 
within active cmd shell
print("\ecd /d C:\Users\Administrator\WebstormProjects")

What would be really helpful is a macros that would show a menu of options, e.g.
print("\ecd /d ", ["C:\Users\Administrator\WebstormProjects", "D:\MongoDB", 
"E:\Wordpress"])

or even multiple menus with filtering options, where "*" stands for all 
commands, e.g.:
print("\enpm ", ["search", "start", "stop", "view", ...], ["*:-h", 
"start:{*.js}", "view:item1|item2|item3"])

Original comment by steven.pribilinskiy on 11 Apr 2014 at 1:12

GoogleCodeExporter commented 9 years ago
@steven.pribilinskiy, try Far Manager. All there...

Original comment by ConEmu.Maximus5 on 11 Apr 2014 at 1:18

GoogleCodeExporter commented 9 years ago
i use Total Commander
and Direct Folders for Bookmarks that work in File Managers and also File 
Dialogs, unfortunately not consoles

Opening FAR every time a new console is opened just to access bookmarked 
folders is kinda obtrusive

Ok, menus and nested menus are probably an overkill, but a single command that 
would just show a menu of all defined Macroses would be quite useful and would 
not force to specify and memorise each Hotkey for Every Macros.

Original comment by steven.pribilinskiy on 11 Apr 2014 at 1:47

GoogleCodeExporter commented 9 years ago
FAR works great as a super-command-shell, try it. You can toggle the panels 
with Ctrl-O.

Original comment by thecybershadow on 11 Apr 2014 at 11:55

GoogleCodeExporter commented 9 years ago
I used Norton Commander and Volkov Commander and FAR about 15 years ago, but 
for historical reasons sticked with Total Commander

Original comment by steven.pribilinskiy on 12 Apr 2014 at 8:44

GoogleCodeExporter commented 9 years ago
I'm not saying you should stop using Total Commander. I'm saying that you 
should try using FAR any time you use cmd.exe.

Original comment by thecybershadow on 12 Apr 2014 at 8:47

GoogleCodeExporter commented 9 years ago
FAR is nothing new for me and there's nothing to try.
When you already use 1 file manager why would you use another?
Suggesting to execute FAR just to show a list of folders is funny.
Currently i have a solution to use Direct Folders through the file dialog that 
is accessible with Ctrl+Shift+F.

Still a menu with all Macroses would be quite useful

Original comment by steven.pribilinskiy on 12 Apr 2014 at 8:54

GoogleCodeExporter commented 9 years ago
The following - my IMHO.
Absolutely agreed with thecybershadow. Far is good choice for a shell. If you 
are in ConEmu, that means you run console applications rarely or often - does 
not matter. Far can fasten and simplify your working process. It integrates 
your console tools (arguments actually) with your file system. And Far has 
powerful scripting language. 

PS. I have no plans to integrate powerful scripting into ConEmu because 
scripting already exists in shells you can run inside ConEmu.

Original comment by ConEmu.Maximus5 on 12 Apr 2014 at 8:56

GoogleCodeExporter commented 9 years ago
> FAR is nothing new for me and there's nothing to try.

You might be surprised if the last time you used it was 15 years ago. It 
evolved quite a lot since then.

Did you know that ConEmu was originally created primarily as a FAR wrapper? 
ConEmu has very tight integration with FAR. Unlike Total Commander, FAR is free 
and open-source.

> When you already use 1 file manager why would you use another?

I don't see why not? Also I was not suggesting that you use it as a file 
manager, but as a bookmark manager. FAR's hotkeys, macros and history plugins 
provide plentiful ways to achieve that goal.

> Suggesting to execute FAR just to show a list of folders is funny.

I don't see the problem with this suggestion, personally.

Original comment by thecybershadow on 12 Apr 2014 at 9:01

GoogleCodeExporter commented 9 years ago
I really don't see any need for using FAR by having TC.
It's a question of habit and i use quite a few TC plugins, like e.g. Virtual 
Disks (kind of Alcohol 120%), Task Manager, EnvVariables editor, Registry 
editor, Uninstaller, Media files viewers etc. and the Button Bar.
While i believe that many of these can be substituted with Far versions, it 
would take quite some time to get used to a new environment.

Anyway, a simple menu with all Macroses, similar to the Tasks menu, would be 
quite useful, though perhaps this can be achieved with an Autohotkey script 
that would parse the settings.xml.

Favorite folders can be also achieved with a simple ahk script that would 
simply 
Send {Esc}cd/d %selectedFolder%

If it is a huge challenge to simply add such a menu, then there's simply no 
reason to ever ask for any new features in ConEmu, due to the attitude of the 
authors.

Original comment by steven.pribilinskiy on 12 Apr 2014 at 9:11

GoogleCodeExporter commented 9 years ago
Steven, sorry if I'm repeating myself but I'm just going to reiterate that I'm 
not asking you to stop using TC or replace TC with FAR. I regret comparing TC 
to FAR already because this was not the impression I was trying to make.

Here is how I suggest solving this problem:

1. Install FAR, and configure ConEmu to start Far instead of CMD (it will do so 
automatically if you unpack it to where you installed FAR)
2. Open the user menu by pressing F2
3. Press the Insert key to add new items. You can type commands such as "cd 
C:\Path" or any other commands.
4. You can trigger these bookmarks in the same way, just click or press Enter 
on the items to run them.

This should not affect your existing CMD workflow, you'll just additionally 
benefit from FAR's features. You don't have to use any other of its features if 
you don't want to.

BTW, please ignore the "Project member" badge near my name, it's from a time I 
contributed a little code and documentation from a while ago. Maximus is nearly 
the sole author of ConEmu.

> then there's simply no reason to ever ask for any new features in ConEmu, due 
to the attitude of the authors.

I agree that it makes little sense to ask Maximus to reinvent the wheel and 
reimplement features that can be trivially emulated with existing open-source 
software.

Original comment by thecybershadow on 12 Apr 2014 at 9:23

GoogleCodeExporter commented 9 years ago
One more thing.
GuiMacro may be posted from any external application (like AHK). And they do 
not have to parse settings. Just post strings encoded into ahk scripts.
Also, you may create a bunch of .cmd or aliases to run "in-console scripts" 
with menus to execute some actions.

Original comment by ConEmu.Maximus5 on 12 Apr 2014 at 10:29

GoogleCodeExporter commented 9 years ago
I know FAR is Cool, it's Great, it have a long story, perhaps as long as TC, 
and i will definitely use it in the future, but currently it looks a bit too 
excessive to include it to every console. Anyway, thanks for the tip with F2 
and this is indeed already a good reason to include far into each console.

So i've configured to start far.exe instead of cmd.exe in the Startup section. 
Looking at integration, the app could be named to FarConEmu :)

To open four consoles i would need to execute:
>far -cur_console:n
far -cur_console:s1TVn
far -cur_console:s1THn
far -cur_console:s2THn

what is the command-line switch to hide the panels at startup (the Ctrl+O 
switch)? Couldn't find in the docs.

The idea behind a menu of macroses is:
1. A quick reference of macroses (alternative to Win+Alt+K, Alt+M)
2. Ability to run macroses from menu
3. Macroses can be used as a Bookmarks/Favorites for paths with print(), 
regardless of currently used shell. E.g. in cmd.exe a user may put cmd/d then 
press the hotkey that shows the macros menu to paste required path
4. Macroses can be used to run some commands inside of current/active pane, as 
Tasks are not designed to run in current pane, the ambiguous -cur_console flag 
have a totally different meaning despite of it's title.
5. Macroses can be used for ...

Currently there's no way to run a macros without defining a hotkey for each one.
And invoking a menu to show a list of all macros would imo make sense for those 
who don't use Autohotkey.

Maximus, what do you mean by telling to "post strings encoded into ahk scripts".

Original comment by steven.pribilinskiy on 12 Apr 2014 at 11:25

GoogleCodeExporter commented 9 years ago
One more question about FAR Background Color
I see that it can be replaced successfully by some Background image
http://i.imgur.com/oOwHlYD.png
Is there a way to replace the background color (make it transparent) without 
using an image?

Original comment by steven.pribilinskiy on 12 Apr 2014 at 12:07

GoogleCodeExporter commented 9 years ago
Take a look at wiki: http://code.google.com/p/conemu-maximus5/wiki/FarManager

I'll try to answer your questions later, when I get to PC
Some hints ATM

F1in Far is great. It even can show all  hotkeys used in Far, including users 
macros. 

Press CtrlO and ShiftF9, panels will remain hidden on restart.

RCtrl+0..9 saves folder shortcut, LCtrl+0..9 restores folder. More in help. You 
may even put several folders on one hotkey and select one from menu.

Far can get Folder path as argument, or you may automate it with any macro on 
startup, just for example

Far "macro:post print(\"hello world\")"

Original comment by ConEmu.Maximus5 on 12 Apr 2014 at 12:24

GoogleCodeExporter commented 9 years ago
As for Far background... misunderstand what do you want exactly.
Far panels color can be set to any RGB value.
ConEmu background field can get not only path to the picture file, but any RGB 
value too.
Background plugin is complicated way to change Far background to anything you 
want due to user defined conditions. For example, highlight some critical 
folders with red background, temp folders with gray, and so on...

Original comment by ConEmu.Maximus5 on 12 Apr 2014 at 12:35

GoogleCodeExporter commented 9 years ago
print() works, keys() are not, e.g. following doesn't work
far "macro:post keys(\"^O\")"

Saving panel state with Shift+F9 does work, but now you can't control that on 
startup.
E.g. to start 4 FAR consoles and one of which to be with panels shown
>far "macro:post keys(\"^o\")" -cur_console:n
far -cur_console:s1TVn
far -cur_console:s1THn
far -cur_console:s2THn

I know about the ability to set colors in FAR, 
it's done with following "small set of keystrokes":
* F9, o, l (Open Menu, Options, Colors)
* P, Enter, B, Left, Left, Left, Left, Down, Space, Enter, Enter (change color 
to Black for Normal text)
* Down, Enter, B, Left, Left, Left, Left, Down, Space, Enter, Enter (change 
color to Black for Selected text)
* do the same thing for Highlighted text, Highlighted Info, Border, ....

There's no indication that an RGB value can be set to the "Path" input field
http://i.imgur.com/IfYgzOE.png
unless you use your mouse pointer to get a tooltip

I use "Ubuntu" color scheme and just wanted FAR to inherit the background color.
With Background image/color is enabled, selected color scheme's background 
becomes visible except the parts where a background image is located or that 
square that is filled with the custom color
http://i.imgur.com/yQ9OS9V.png

I can select Stretch for selected color, but better i would like to see a 
Rectangle size value, instead of going to Color section of the Settings dialog 
to copy/paste the color#0 value
That's just unintuitive.

Original comment by steven.pribilinskiy on 12 Apr 2014 at 1:09

GoogleCodeExporter commented 9 years ago
Far doesn't support AHK notation. The proper call is Keys("CtrlO"). And as wiki 
said you may record you keypresses to reuse them.

Original comment by ConEmu.Maximus5 on 12 Apr 2014 at 1:28

GoogleCodeExporter commented 9 years ago
with far "macro:post keys(\"CtrlO\")"
still got an error: http://i.imgur.com/rNRjmPD.png

Original comment by steven.pribilinskiy on 12 Apr 2014 at 1:33

GoogleCodeExporter commented 9 years ago
also there's a broken link in 
https://code.google.com/p/conemu-maximus5/wiki/FarManager
the one that targets
<a 
href='http://translate.google.ru/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fapi.
farmanager.com%2Fru2%2Fmacro%2Fmacrocmd%2Findex.html'>Macro Language</a>

Original comment by steven.pribilinskiy on 12 Apr 2014 at 1:40

GoogleCodeExporter commented 9 years ago
> "And as wiki said you may record you keypresses to reuse them."
Didn't get the point of recording keypress for this case.
To record "Ctrl+O" and assign to another hotkey? What's the point?

Original comment by steven.pribilinskiy on 12 Apr 2014 at 1:42

GoogleCodeExporter commented 9 years ago
The case matters. You may note, Keys but not a keys.

https://code.google.com/p/conemu-maximus5/wiki/FarManager#5._Automation

Original comment by ConEmu.Maximus5 on 12 Apr 2014 at 2:19

GoogleCodeExporter commented 9 years ago
That worked, thanks.

Original comment by steven.pribilinskiy on 12 Apr 2014 at 5:47