Saving files and saving sessions

Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Its regression. made the fix. beta updated in /c.
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post by tmsg »

Seems to work.

I still have the problem that -ns does not save the default session and as I explained I do not think at all that wanting to do this is logically inconsistent. It definitely worked in earlier version as I think it should.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Made update now. it must be ok for you, and for that user who asked that -ns must block saving of DEFAULT session. -ns now blocks saving _default_ session, but any other session saving is allowed.
beta updated.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

>>>Or put differently and more simply, no matter what I do (whether I load a named session or use the default session, load files, save files, don't load or don't save files etc etc), I always want the session state saved when I leave Cud. ALWAYS.

Last change is not like you tell here. it saves session on exit only if its NOT DEF session. why?

- open 2 files a+b, exit Cud, DEF session saved with 2 files a+b
- run "cudatext d -ns", exit Cud - now Cud DONT save filename d to session! if it does, then old good session with a+b will be lost! so now Cud don't do it. logical?
- run "cudatext d -ns", and choose custom session. on exit, Cud saves "d" to session.
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post by tmsg »

I will look at the latest beta later and will test it with my various setups and report.

Can you also upload a Linux version of the current 115.3?
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

.deb file? Ok, uploaded.
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post by tmsg »

Thanks. I'll check this tomorrow.
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post by tmsg »

I've now tested the current beta (115.3) on Windows and Linux and so far have encountered no problems with the session handling other than the change in -ns behaviour with the default session. I can circumvent this change in a slightly clumsy way with a batch file or bash script.

This whole saga has left me scratching my head. Cud is a great editor but I want to edit files and not chase bugs and regressions or fight changes that are not backwards compatible. Some degree of this is unavoidable but this has been a bit much for my taste.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

So what do you suggest. to save session in exit _always? see the above use case. user will loose good session with files a+b, when Cud saves session with "d".
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post by tmsg »

Back in May, when I saw this option in the Wiki:

Code: Select all

-ns - Ignore saved session
I assumed this meant that no session would be loaded on start-up but that the session state would be saved on exit. And so it worked.

Then, over summer, you changed that (losing backwards compatibility in the process). For my own workflow (which is 100% command-line based) I can work around that change (in a batch/bash script) by dropping -ns from my command lines and copying an empty "history session.empty" file to "history session.json". This is dead ugly but it sort of works.

Perhaps the cleanest solution would be to split -ns into two further options: -nsl and -nss. The first (-nsl=no session load) runs Cud with no session loaded but will save the session state in the end. The second (-nss=no session save) loads a session but doesn't save any changes on exit. (-ns could stay as a shortcut to do both or could go.)

As these are command line options for people who (hopefully) know how to properly use the command line I don't think this would complicate matters too much... but I've been known to be too optimistic in that regard. :(
Post Reply