dynamic-cli icon indicating copy to clipboard operation
dynamic-cli copied to clipboard

Dynamic CLI support for windows OS

Open guptaaastha opened this issue 3 years ago • 26 comments

Currently Dynamic CLI has a dependency on the termios module. This module does not support windows OS (refer the links provided below for reference). This issue is to point attention towards this drawback and open up a conversation whether this is something that can be addressed.

Please refer: https://docs.python.org/3/library/tty.html https://docs.python.org/3/library/termios.html#module-termios

guptaaastha avatar May 19 '21 11:05 guptaaastha

Hi👋 thanks for creating your first issue for IOSF, Will get back to you soon !.

github-actions[bot] avatar May 19 '21 11:05 github-actions[bot]

This dependency has been caused because of the simple-term-menu module. We need this module for StackExchange results to be printed the way they are. Please refer to PR #89. Windows users can use WSL for using Dynamic-CLI.

NamamiShanker avatar May 19 '21 12:05 NamamiShanker

One can surely use WSL but that would make Dynamic CLI restrictive and available only for users who are on Unix OS. I think we should try to be more inclusive and find alternatives that support all users regardless of their OS 😄

guptaaastha avatar May 19 '21 12:05 guptaaastha

Yes @guptaaastha, the cli is not supporting windows right now due to the termios package used in the application. The module is not yet implemented for windows. We are searching for a way to solve this issue. All contributions are appreciated.

lainq avatar May 19 '21 12:05 lainq

We can use curses but that can reduce UI/UX capabilities.

NamamiShanker avatar May 19 '21 12:05 NamamiShanker

We can use curses but that can reduce UI/UX capabilities.

Hmm yeah

lainq avatar May 19 '21 12:05 lainq

Right now, I am planning to use an online linux environment like repl.it or CS50 IDE.

lainq avatar May 19 '21 12:05 lainq

Right now, I am planning to use an online linux environment like repl.it or CS50 IDE.

That's one way to go yes, I think we should still be on the look for a more inclusive module 🚀

guptaaastha avatar May 19 '21 12:05 guptaaastha

I think we can do specific change only for windows env. So that other would not face UX issues.

GouravSardana avatar May 19 '21 17:05 GouravSardana

Or else we need to find out some other way to support all the environment equally and efficiently.

GouravSardana avatar May 19 '21 17:05 GouravSardana

Or else we need to find out some other way to support all the environment equally and efficiently.

I think this is what we have to do

lainq avatar May 19 '21 17:05 lainq

I'll do a research and find any alternative. You guy's can also search, If you find anything do let me know here.

GouravSardana avatar May 19 '21 18:05 GouravSardana

This is quite useful. You guys can also take a look. 2-3 people gave suggestions regarding the same problem that we are facing - https://github.com/bchao1/bullet/issues/2

GouravSardana avatar May 21 '21 16:05 GouravSardana

This is quite useful. You guys can also take a look. 2-3 people gave suggestions regarding the same problem that we are facing - bchao1/bullet#2

But, they don't have a solution for that 🙁

lainq avatar May 22 '21 05:05 lainq

They have but that was specific to windows only. Still searching for some other alternative

GouravSardana avatar May 22 '21 07:05 GouravSardana

Let's be on the lookout for solutions

guptaaastha avatar May 22 '21 08:05 guptaaastha

https://github.com/IndianOpenSourceFoundation/dynamic-cli/discussions/97

lainq avatar May 22 '21 15:05 lainq

@pranavbaburaj i think you wrote wrong. It's not support for windows and by mistake you wrote it only supports for windows

GouravSardana avatar May 22 '21 16:05 GouravSardana

@pranavbaburaj i think you wrote wrong. It's not support for windows and by mistake you wrote it only supports for windows

I just noticed this too, @pranavbaburaj please correct it.

guptaaastha avatar May 22 '21 16:05 guptaaastha

I have updated it, Thank you 🙂

lainq avatar May 22 '21 17:05 lainq

We can use this as a backup option for windows- https://github.com/aegirhall/console-menu

GouravSardana avatar Jun 18 '21 09:06 GouravSardana

Hmm, but we will have to rewrite it entirely or reimplement it for windows 🤔

lainq avatar Jun 18 '21 11:06 lainq

Fow now should we only integrated it when OS is windows ?

GouravSardana avatar Jun 18 '21 13:06 GouravSardana

Fow now should we only integrated it when OS is windows?

Yeah, We first check if the platform is windows, then create this interface for windows

lainq avatar Jun 18 '21 13:06 lainq

@pranavbaburaj Yes, This can be done but this would be temp. We have to migrate the whole things to something else

GouravSardana avatar Jun 21 '21 10:06 GouravSardana

There is a workaround to make it work on window

if os.name == "nt":
  import msvcrt
else:
  import terminos

That is we can check if the current os the user is on is windows or not if we found its windows import msvcrt and replace the same functionalities which are done using terminos . @GouravSardana @pranavbaburaj this solution should work and looks like the only workaround rn.

Moreover the dependency due to which the error occurs i.e simple-term-menu this can be referred.

Manas1820 avatar Mar 10 '22 16:03 Manas1820