Closed dmille closed 3 years ago
Hi Julien,
I agree with you, we should not duplicate too much logic! I've reworked it a bit and used your suggestion :). I'd say it's much cleaner now.
I've also changed a few things to so that the new-window
command line argument replicates the make-window
command functionality more closely.
Let me know what you think. Cheers
Hi David, Thanks for the quick update! :). I find the implementation in ipc.py much cleaner. However I don't think I like much the idea of doing the same thing with new-window and make-window; to me, we should be able to use --new-window with --url, thus opening an url in the new window. So I guess in this case we do not need to move get_or_create_buffer, and in ipc.py the logic should go down to something like:
if url:
elif new_window
What do you think?
How do you feel about my last change?
Personally, for my usage, I bind webmacs --new-window
to a shortcut in my window manager (i3wm) and would like to expect the same behaviour as the make-window
command.
However, I agree that the expected behaviour of webmacs --new-window url
should open the passed url in a new window instead, so I've added that.
I believe this last change is a good compromise. I'm basing this just on my own usage of webmacs :).
If you like, I could change the functionality to display the home page instead? But I would still like to replicate the make-window
command from the command line in some way because of how I use my environnment. Also, I feel as if since it's still the same instance
, it should still act the same. Maybe for new instances it can be different? Or maybe it should be called webmacs --make-window
to be consistent?
Thoughts?
I've added functionality for calling
--new-window
to open a new window in an existing instance. I'd like to add the same functionality from commands/global.py with the _get_or_create_buffer function, however since the file is global.py in conflicts with built inglobal
and I can't import it. I don't want to duplicate any code obviously. Any suggestions for how to resolve this? Maybe global.py should be renamed in the codebase? @parkouss