Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
nikov
Posts: 116
Joined: Fri Dec 24, 2021 10:31 am

Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by nikov »

Greetings,
Is it possible to exclusively open a window/tab with a setting enabled/disabled?
Such as this command:

Code: Select all

Everything64.exe -config-value omit_results=0 -search "C:\" -select C:\file.ogg
But this command sets "omit_results=0" for subsequent windows/tabs too but I want this to happen exclusively for the window/tab that is generated by such command.

Or, is there any way to do this?

Thank you.
therube
Posts: 4617
Joined: Thu Sep 03, 2009 6:48 pm

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by therube »

Two quick thoughts...

Use a separate -instance for your omit_results work, maybe call it, -instance OMIT.

Maybe ? a setting in Tools | Options | Home -> Search can be set to un-omit -omit_results ?
nikov
Posts: 116
Joined: Fri Dec 24, 2021 10:31 am

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by nikov »

therube wrote: Mon Mar 11, 2024 2:58 pm
Thank you therube,
Yes, it can be done with multi-instance but it comes with problems/inconveniences. Such as, you always have to copy the whole instance every time you start a search without omit results.
If the instance is big, it will take a lot of time to copy and will take up a lot of additional memory and storage space just to disable a setting.
Then also, you will have to be careful about not to open any new window from that instance for usual search.

Otherwise, if you plan to not copy the whole instance every time and want to reuse the old multi instances, then the problem of maintaining multiple instances comes. In this case, if you want all the instances to look and behave the same, then you will always have to change the settings of all the instances whenever you make a change to any of the instances.
Suppose, you have added a column to instance 1, then you will also have to manually add that column to instance 2, instance 3, etc. to make all the instances' look and behavior same.
That's a lot of things to face just to disable a simple setting for a window/tab. This is overkill.


The solution to this problem can be very easy:
I just noticed that Everything does not follow the config settings while opening a new window, rather it follows the settings of the parent window.

Otherwise these two commands would suffice to solve this problem:

Code: Select all

Command 1: Everything64.exe -config-value omit_results=0 -search "C:\" -select C:\file.ogg
Command 2: Everything64.exe -config-value omit_results=1 -startup
The first command would set "omit_results=0" for only the newly opened "C:\" window.
And the second command would silently set "omit_results=1" for all subsequent windows.

But this would only happen if new window follows the settings of the config, instead of the parent window.
For me, I don't like this behavior of new window following the settings of the parent window, instead of the config. There can be users who may think otherwise.
Thus, an ini setting to toggle this behavior can be helpful, similar to this:
"new_window_follows_config" or "new_window_follows_config" and "new_tab_follows_config"

In short, I tried to mean, there can be an easy solution for this problem. Just my guess.

Isn't it?

Thank you.


Update:
Don't know what is happening inside Everything but the mentioned two commands work only if "home_omit_results=1" and maybe "omit_results_persist=1" is set.
You also mentioned this in your quick thoughts that a setting maybe found in "Tools-->Options-->Home". Yes, but a setting regarding this; is not found here but it is rather found in "Tools-->Options-->Advanced". Maybe will be added later in "Tools-->Options-->Home".
But only setting this setting is not sufficient, you also then have to run the

Code: Select all

Everything64.exe -config-value omit_results=1 -startup
command after the

Code: Select all

Everything64.exe -config-value omit_results=0 -search "C:\" -select C:\file.ogg
command. But it seems like, between these commands maybe a wait is needed to make it more reliable. But how much it should wait? Is 1 second sufficient?

If it works, it works for both new windows and new tabs, which is fine for me.

But this approach may just solve only this problem of "omit_results" setting. This approach does not work for all usable settings/options. Such as, another important setting in this use case can be the "preview_visible" config. And this approach of

Code: Select all

START Everything64.exe -config-value preview_visible=1 -search "C:\" -select C:\file.ogg
TIMEOUT /T 1
START Everything64.exe -config-value preview_visible=0 -startup
does not work for "preview_visible" setting.

Thank you.
nikov
Posts: 116
Joined: Fri Dec 24, 2021 10:31 am

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by nikov »

Previous reply was updated with another example for more clarity.
NotNull
Posts: 5275
Joined: Wed May 24, 2017 9:22 pm

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by NotNull »

Does this work for you? (untested)

Code: Select all

Everything64.exe -search-command "/enable-omit-results" -newwindow
Everything64.exe -newwindow
nikov
Posts: 116
Joined: Fri Dec 24, 2021 10:31 am

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by nikov »

NotNull wrote: Tue Mar 12, 2024 5:10 pm
Thank you NotNull,
I didn't notice about "search-command" method and then I tried in this method:

Code: Select all

Everything64.exe -search-command "/disable-omit-results" -search "C:\" -select C:\file.ogg
But it has a side-effect, it deactivates selection in this case.
Just a guess:
This is happening due to "disable-omit-results" command is applied after Everything is started. (Can be easily seen by clicking "Index-->Enable Result Omissions".)
But this does not happen if "disable-omit-results" command is applied before Everything is started. Such as using "config-value" method, like these commands:

Code: Select all

START Everything64.exe -config-value omit_results=0 -search "C:\" -select C:\file.ogg
TIMEOUT /T 1
START Everything64.exe -config-value omit_results=1 -startup
As I mentioned earlier, although the "config-value" method works well for the "omit_results" setting, it does not work for all settings. Such as, "preview_visible".
Both the "search-command" and "config-value" method fails to exclusively open a window/tab with a preview pane enabled.
This is happening because a new window/tab follows the settings of the parent window/tab, instead of the config.
If you open a new window/tab from a window with a preview pane, Everything opens a new window/tab with the preview pane enabled. Everything does not honor/follow the config, even if you set it with:

Code: Select all

Everything64.exe -config-value preview_visible=0 -startup
, it rather follows the setting of the parent window.

Thank you.
NotNull
Posts: 5275
Joined: Wed May 24, 2017 9:22 pm

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by NotNull »

nikov wrote: Tue Mar 12, 2024 10:06 pm As I mentioned earlier, although the "config-value" method works well for the "omit_results" setting, it does not work for all settings. Such as, "preview_visible".
config-value changes the setting in the INI file ("everything.ini"), so that is a more definitive/permanent way.
What should Everything do if it starts a new window? In my opinion: honor the settings in everything.ini.

nikov wrote: Tue Mar 12, 2024 10:06 pm -config-value preview_visible=0
Try instead with::

Code: Select all

/show-preview
nikov wrote: Tue Mar 12, 2024 10:06 pm Everything64.exe -startup
with -startup, Everything will be started *without* GUI (mainly the database and monitoring parts are loaded).

Not sure, but this command might do nothing as Everything is already loaded.
nikov
Posts: 116
Joined: Fri Dec 24, 2021 10:31 am

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by nikov »

NotNull wrote: Tue Mar 12, 2024 10:21 pm config-value changes the setting in the INI file ("everything.ini"), so that is a more definitive/permanent way.
Yes, that is maybe the reason the setting is applied before Everything starts and also, after 1 second later you are changing it back with the following command:

Code: Select all

START Everything64.exe -config-value omit_results=1 -startup
Also, config-value does not immediately write in the INI file, it maybe first writes in the memory, then when an Everything window is closed, then Everything writes in the INI file.


NotNull wrote: Tue Mar 12, 2024 10:21 pm What should Everything do if it starts a new window? In my opinion: honor the settings in everything.ini.
Yes. It is your opinion too and my opinion too. But Everything honors the settings of the parent window.


NotNull wrote: Tue Mar 12, 2024 10:21 pm Try instead with::

Code: Select all

/show-preview
Tried with:

Code: Select all

Everything64.exe -search-command "/show-preview" -search "C:\" -select C:\file.ogg
, but just like the earlier, it enables preview pane for all the subsequent new windows/tabs because it follows the settings of the parent window instead of the config.


NotNull wrote: Tue Mar 12, 2024 10:21 pm with -startup, Everything will be started *without* GUI (mainly the database and monitoring parts are loaded).

Not sure, but this command might do nothing as Everything is already loaded.
Made some experiments with this "-startup" command and found that, it can be used to silently apply Everything commands. Another command that could do this was "-no-new-window", but it is not completely silent, it defocuses the results window. There can be other ways, but I don't know now.


Thank you.
void
Developer
Posts: 15395
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by void »

Everything 1.5.0.1372a adds the following command line options:

-enable-result-omissions
-disable-result-omissions



Set the default result omissions state with the advanced home_omit_results setting.
nikov
Posts: 116
Joined: Fri Dec 24, 2021 10:31 am

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by nikov »

void wrote: Fri Apr 19, 2024 6:45 am Everything 1.5.0.1372a adds the following command line options:

-enable-result-omissions
-disable-result-omissions



Set the default result omissions state with the advanced home_omit_results setting.
Thank you. But this does not work properly if "Tools->Options...->General->UI->Run in background" or "Tools->Options...->General->UI->Create a new window when running Everything" is checked:

Tested, this does not work properly in those cases:

Code: Select all

Everything64.exe -disable-result-omissions -search "C:\" -select C:\file.ogg
In those cases, "-disable-result-omissions" deactivates the selection of "C:\file.ogg" after few milliseconds.

Note that, it was already mentioned in this thread that, this works properly if "home_omit_results=1" and maybe "omit_results_persist=1":

Code: Select all

START Everything64.exe -config-value omit_results=0 -search "C:\" -select C:\file.ogg
TIMEOUT /T 1
START Everything64.exe -config-value omit_results=1 -startup
Also note that, even if "-disable-result-omissions" worked properly this would not solved the issue of this thread. Because this would only solved the issue for a single setting.

The issue is about a generalized solution which is not specific to just only omit results settings. Such as, the "preview_visible" setting was also discussed here, for which Everything does not honor/follow the config. They were discussed in details in this thread.

Thank you.
void
Developer
Posts: 15395
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by void »

Please don't use -config-value to setup your window.

New tabs/windows inherit settings from the current window.



Please use the window command line options to setup your new window.

For example:

Everything.exe -preview
Everything.exe -no-preview
Everything.exe -enable-result-omissions
Everything.exe -disable-result-omissions



Everything 1.5.0.1373a fixes an issue with -enable-result-omissions/-disable-result-omissions being applied after the new window/tab was created.
nikov
Posts: 116
Joined: Fri Dec 24, 2021 10:31 am

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by nikov »

void wrote: Thu Apr 25, 2024 6:59 am Everything 1.5.0.1373a fixes an issue with -enable-result-omissions/-disable-result-omissions being applied after the new window/tab was created.
Thank you.
Tested. Now, both "-disable-result-omissions" and "-enable-result-omissions" are working nice.


void wrote: Thu Apr 25, 2024 6:59 am Please don't use -config-value to setup your window.
I understand, it is not the preferred way. But previously there was no better choice. Now after the "-enable-result-omissions/-disable-result-omissions" options are added, "-config-value" method is not needed for omit results. But this is only applicable for "omit results" settings.


void wrote: Thu Apr 25, 2024 6:59 am "New tabs/windows inherit settings from the current window."
Can you consider adding an option such that, new tabs/windows inherit settings from the config?
I know, default window setups can be fixed from "Tools->Options...->General->Home", but this is not complete. Such as, it has no option to fix preview pane visibility (or other options). That's why I was just asking to make it more generalized/custom by inheriting settings from the config for new tabs/windows. Or it can be any method that fixes a setting exclusively for a window/tab.


void wrote: Thu Apr 25, 2024 6:59 am Please use the window command line options to setup your new window.

For example:

Everything.exe -preview
Everything.exe -no-preview
Everything.exe -enable-result-omissions
Everything.exe -disable-result-omissions
I don't understand, why you have given the "-preview/-no-preview" command line example? This "-preview" command line option does the opposite of what I am asking for. It cannot exclusively open a window/tab with a preview pane (this does not prevent new windows/tabs from opening a preview pane). Combination of both "-preview" and "-no-preview" does not work either. Thus, it is not a solution for the issue. I don't know, did I fail to make you understand the issue? :(

Thank you.
void
Developer
Posts: 15395
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by void »

Thank you for your feedback nikov,


Can you consider adding an option such that, new tabs/windows inherit settings from the config?
To disable inheriting settings for new windows:
  • In Everything 1.5, from the Tools menu, click Options.
  • Click the Advanced tab on the left.
  • To the right of Show settings containing, search for:
    inherit
  • Select: new_inherit
  • Set the value to: false
  • Click OK.
I am considering renaming this advanced setting to new_window_inherit and adding a new_tab_inherit option.
Implementing new_tab_inherit would be a lot of work..

Closing a window will update your config, so there's no easy way to define the default value yet..


I don't understand, why you have given the "-preview/-no-preview" command line example?
I am not sure what you want here.
It sounds like you want a once off way to show/hide the preview pane.



Including preview: or no-preview: in your search could be used as a once off way to show or hide the preview pane.



-preview/-no-preview will only work for the shown window.
Combine with -new-tab or -new-window (or -no-new-tab or -no-new-window if you have enabled Tools -> Options -> UI -> Create a new window when running Everything)



To always show the preview pane on new tabs/windows:
  • In Everything 1.5, from the Tools menu, click Options.
  • Click the Advanced tab on the left.
  • To the right of Show settings containing, search for:
    home
  • Select: home_add_layout
  • Set the value to: preview
  • Click OK.


To always hide the preview pane on new tabs/windows:
  • In Everything 1.5, from the Tools menu, click Options.
  • Click the Advanced tab on the left.
  • To the right of Show settings containing, search for:
    home
  • Select: home_remove_layout
  • Set the value to: preview
  • Click OK.


preview:
no-preview:
home_add_layout
home_layout
home_remove_layout
nikov
Posts: 116
Joined: Fri Dec 24, 2021 10:31 am

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by nikov »

void wrote: Fri Apr 26, 2024 2:20 am
Thank you for discussing about so many options to achieve this. The "preview:" Search Function and "home_remove_layout" setting is a nice way to do this. But they are not for all config settings.
Also, "new_inherit=0" does not work for all settings, such as disabling the "Size" column still echoes in the subsequent new windows. Also, as closing a window updates config, so this is not much of a use now.

Also note that, not just "new_inherit=0", the "home_remove_layout" also does not work for new tabs.

But they are not a big problem for me for now. As I can use Search Functions and "home_.*" settings to exclusively fix the settings that I find most useful. And also, as I am not much of a tab user for now. So, I will just have to adapt to this for now.

And also thank you for considering these features for new tabs in the future.
void
Developer
Posts: 15395
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by void »

Thank you for your feedback nikov,


Thank you for discussing about so many options to achieve this. The "preview:" Search Function and "home_remove_layout" setting is a nice way to do this. But they are not for all config settings.
There should be search functions that cover all window/view options.
If there is any missing, please let me know.

I need a window category in search functions..

You can lock any config setting with your registry.


Also, "new_inherit=0" does not work for all settings, such as disabling the "Size" column still echoes in the subsequent new windows. Also, as closing a window updates config, so this is not much of a use now.
I think what you are after is a -no-update-config command line option which flags the existing/new-tab/new-window to not update the config on close.
Another step further, there could be a -uninheritable command line option which flags the existing/new-tab/new-window as uninheritable (new-tabs/new-windows will not inherit settings from this window).
Maybe an -exclusive command line option could combine these..


Also note that, not just "new_inherit=0", the "home_remove_layout" also does not work for new tabs.
new_inherit will work for tabs in the next alpha update.
I will consider applying home_remove_layout to new tabs.
nikov
Posts: 116
Joined: Fri Dec 24, 2021 10:31 am

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by nikov »

void wrote: Sat Apr 27, 2024 12:04 am There should be search functions that cover all window/view options.
If there is any missing, please let me know.
Such as, how to exclusively open a window/tab with a specific Theme, Fonts and Colors (this should not affect other past or future windows/tabs and should not be inherited, of course).

This is not that much important to me for now. But you have asked for all window/view options. Maybe some users will find that useful in the future. These are just some examples, still now I didn't search for all settings. That's why I was talking about a generalized simple solution that will inherit settings from a locked config for all new windows/tabs, and changing the layout/settings of one window/tab will not affect others. Otherwise, you will have to search and put all the settings manually by hand, that's I guess a lot of work. I guess, I will have to make a list about which settings are worthy to lock (this is more like a list of more temporary Search Functions or "home_.*" settings).


void wrote: Sat Apr 27, 2024 12:04 am You can lock any config setting with your registry.
Thank you for discussing another option. And this was working nice (tested with "preview_visible=1"). But then I found it cannot lock any config setting, such as "size_column_visible=1". I checked "Help -> Troubleshooting Information" and it shows:
Policy: preview_visible=1

But nothing mentioned about the "size_column_visible=1".
This also does not work for tabs, I guess this will be fixed when "new_inherit" setting will support tabs.


void wrote: Sat Apr 27, 2024 12:04 am I think what you are after is a -no-update-config command line option which flags the existing/new-tab/new-window to not update the config on close.
Another step further, there could be a -uninheritable command line option which flags the existing/new-tab/new-window as uninheritable (new-tabs/new-windows will not inherit settings from this window).
Maybe an -exclusive command line option could combine these..
I didn't find these settings "-no-update-config", "-uninheritable", "-exclusive"; I guess you were talking about hypothetical or in the future. Yes, they would be nice.

Thank you.
void
Developer
Posts: 15395
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by void »

Temporarily setting the font color is probably overkill at this stage.

I will support any window/view options that you can change directly (without going into settings) eg: view -> thumbnails


Thank you for discussing another option. And this was working nice (tested with "preview_visible=1"). But then I found it cannot lock any config setting, such as "size_column_visible=1".
Thanks for bringing this to my attention.
I thought I had a way to lock columns.
My intentions were to only allow locking home columns.
I will look into adding support for locking columns.
nikov
Posts: 116
Joined: Fri Dec 24, 2021 10:31 am

Re: Is it possible to exclusively open a window/tab with a setting enabled/disabled?

Post by nikov »

Thank you,
Also, another thing to note, registry and group policy method is not fully portable. It does support portable Everything. But it needs to store/write settings outside of the portable directory to work. Thus, it is not fully portable method. So, a fully portable method would be nice.
Post Reply