cyd01 / KiTTY

:computer: KiTTY, a free telnet/ssh client for Windows
https://www.9bis.com/kitty
Other
1.58k stars 136 forks source link

Linux compilation #100

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi all,

@cyd01 I wanted to know if is technically possible to compile KiTTY targeting linux gtk if setting up Makefiles properly or have you made changes in the source code that requires the system to be Windows exclusively ?

Wanted to know because, despite the original PuTTY description mentioning it is for Windows, the project brings mkfiles.pl that is generating a Makefile.gtk and so on, PuTTY compiles and runs fine under Linux as shown below.

Screenshot from 2020-01-22 14-11-56

Any reason to target Windows exclusively ? PuTTY alone is very limited compared to the options brings KiTTY.

Thank you @cyd01

cyd01 commented 4 years ago

Unfortunately: KiTTY is only designed for the Microsoft® Windows® platform Cyd

Le mer. 22 janv. 2020 à 14:17, Arnaud.Dovi notifications@github.com a écrit :

Hi all,

@cyd01 https://github.com/cyd01 I wanted to know if is technically possible to compile KiTTY targeting linux gtk if setting up Makefiles properly or have you made changes in the source code that requires the system to be Windows exclusively ?

Wanted to know because, despite the original PuTTY description mentioning it is for Windows, the project brings mkfiles.pl that is generating a Makefile.gtk and so on, PuTTY compiles and runs fine under Linux as shown below.

[image: Screenshot from 2020-01-22 14-11-56] https://user-images.githubusercontent.com/52439/72897175-3f146780-3d19-11ea-9fa8-65946c68f8df.png

Any reason to target Windows exclusively ? PuTTY alone is very limited compared to the options brings KiTTY.

Thank you @cyd01 https://github.com/cyd01

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cyd01/KiTTY/issues/100?email_source=notifications&email_token=AIESOBXHMU5LW4KSKMIUUVLQ7BBNDA5CNFSM4KKFTO32YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IH6IV6A, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIESOBR7EYAW5KZ3Q6HNZ7DQ7BBNDANCNFSM4KKFTO3Q .

ghost commented 4 years ago

Do you think it would require a lot of effort to bring unix compatibility to it ?

I'm trying to find out if I get it to compile under unix, would your changes be portable to both systems or have you coded the fork with only Windows in mind

I ask you that because I miss kitty on linux and is a perfect candidate for aur.archlinux.org

Edit: Well I realiazed I answered my own question, if I get it to compile, the changes between Linux and Windows might be trivial as it is not a core system app, correct me if I'm wrong.

cyd01 commented 4 years ago

I’ve made for Windows only and i don’t Think it can be compiled for Linux I’m sorry Cyd

Le mer. 22 janv. 2020 à 16:59, Arnaud.Dovi notifications@github.com a écrit :

Do you think it would require a lot of effort to bring unix compatibility to it ?

I'm trying to find out if I get it to compile under unix, would your changes be portable to both systems or have you coded the fork with only Windows in mind

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cyd01/KiTTY/issues/100?email_source=notifications&email_token=AIESOBWZLMKFH44VLGSIQTDQ7BUMJA5CNFSM4KKFTO32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJUDOAI#issuecomment-577255169, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIESOBWMH3FN4BYHBSSENTLQ7BUMJANCNFSM4KKFTO3Q .

lars18th commented 4 years ago

Hi @ArnaudDovi and @cyd01 ,

That's my point of view:

So, perhaps someone (Arnaud?) can provide a fork of KiTTY disabling all Windows only patches. Then all other characteristics can be adapted to work in Linux too. For example, the most relevant functionality of KiTTY, the PORTABLE version, can work in Linux (even in Linux the stock PuTTY version uses files too).

I hope it helps. Regards.

ghost commented 4 years ago

Yeah that's what I'm testing yet

Cyd as well done the fork, with Defines everywhere a new feature has been done.

So for now I have a version that is compiling yet with kitty defines yet disabled

Few example of the things to do

In my opinion this is possible with enough time and knowledge, I usually code in j2ee here at work in france, but could attempt to do something

lars18th commented 4 years ago

Hi @ArnaudDovi ,

Previous to launch you in this work, I suggest a more simple test:

Do you agree @cyd01 with this test?

ghost commented 4 years ago

Yet I'm trying this yeah, I'm disabling all MOD_PERSO and other variables, problems lies in sshpubk.c, this code is common to Windows and Linux, and has a lot of changes for KiTTY without any MOD_PERSO or other variable defined.

So I'm attempting in reimporting all the deleted codes to place inside a variable named like "MOD_PERSO_UNIX" to track changes more easily but there are a lot to do haha.

I have attempted the other way, bring new KiTTY methods to sshpubk.c, that is quicker to patch but result is unexpected at this stage of testing this under unix

lars18th commented 4 years ago

Hi @ArnaudDovi ,

Well done! I hope you can provide a clean UNIX patch soon. Please, comment if you need some beta testing.

Regards.

Note: I recommend to fork the current KiTTY repository and commit to your personal unix-branch the changes you're doing. Even if they don't work. With this we can provide some feedback. :wink:

ghost commented 4 years ago

Sure will do , I had in mind to track everything with patch files so I can share it for you as an upgrade and to bring kitty to arch linux user repo

Yet it compiles and runs fine, I have added a MOD_KITTY , basically when not set and Kitty mod options not set aswell, your sources produces an official PuTTY, thanks Meld powerful comparator :)

Screenshot from 2020-01-23 23-58-32

cyd01 commented 4 years ago

Yes Without any MOD_ makefike produces an original PuTTY MODPERSO is the main patch that is the base for all others MOD You can compile KiTTY with or without any other MOD_* than MOD_PERSO, but most of them really need it Just a remark why don’t you use KiTTY with wine ? It works fine with it.

Le jeu. 23 janv. 2020 à 23:49, Arnaud.Dovi notifications@github.com a écrit :

Sure will do , I had in mind to track everything with patch files so I can share it for you as an upgrade and to bring kitty to arch linux user repo

Yet it compiles and runs fine, I have added a MOD_KITTY , basically when not set, your sources produces an official PuTTY :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cyd01/KiTTY/issues/100?email_source=notifications&email_token=AIESOBTYYWAODISJM7SBEDLQ7INJFA5CNFSM4KKFTO32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJZENOQ#issuecomment-577914554, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIESOBQOEKVCBEE2BOF2EQ3Q7INJFANCNFSM4KKFTO3Q .

lars18th commented 4 years ago

Hi @cyd01 ,

Just a remark why don’t you use KiTTY with wine ? It works fine with it.

Because it's more efficient to run navite. And then it can be added to some distribution repositories too.

Hi @ArnaudDovi ,

Yet it compiles and runs fine, I have added a MOD_KITTY , basically when not set and Kitty mod options not set aswell, your sources produces an official PuTTY, thanks Meld powerful comparator :)

So my first recomendation now is to share your current work (that's compile it in plain mode in Linux). In this case please do this:

If this is done then perhaps @cyd01 will accept to merge it with the current KiTTY repository (perhaps in a different branch). And after this you can start to enable/test some KiTTY mods... the first one: change the name! :wink:

Regards.

ghost commented 4 years ago

Just a remark why don’t you use KiTTY with wine ? It works fine with it

@cyd01 Probably for the same reason everyone hates wine under Linux to run that small application, while wine can be suitable in some case, like Valve Proton to run Windows designed games on Linux, it is really a killer framework for such small application as PuTTY. Everything is bad, performance, no GTK theme integration, Visual look ugly and worse than Windows, bugs of unsupported software features, etc, etc...

In my opinion, I could return the question to you

Why did you choose to code in a Windows only supported manner, while you are forking from a fantastic software architecture that supports Windows + Linux + MacOS all that natively.

Because usually today, if you choose to target Windows only, you go for .NET C#, .NET VB, something owned by Microsoft, if the developer choose the steep step to build in C/C++ today thats much for code portability and speed.

So why did you break that and transformed that fantastic Multi platform architecture to a Windows only architecture would be a more valid question ;)

@lars18th Thank you for the feedback, well anyway yet I'm far from being done I think, lots of part of KiTTY code is Windows only, bringing Multi platform support is possible but slower. I will probably not have a patch ready for you to implement but much a POC patch targeting Unix and Windows you will be able to take as base if you choose to bring Multi platform support to the KiTTY fork.

For example all the reference to MOD_KITTY I have placed are much placeholders for a temp usage, I guess the correct way to update would be to rename each MOD_KITTY changes to the corresponding variable name you have already attributed for example, some MOD_KITTY changes belongs to MOD_PERSO, some other to MOD_NOHYPERLINK, etc etc..

lars18th commented 4 years ago

Hi @ArnaudDovi ,

First of all. Please stop to comment about some personal point of view regarding the use/implementation in different platforms. The current KiTTY project is Windows only. However, if someone can help to achieve Windows/Unix compatibility then... it will be welcome. :wink:

After that, I suggest this change: Replace current MOD_PERSO to MOD_PERSO_WIN. Then add MOD_PERSO_ALL and MOD_PERSO_UNIX. The idea is quite simple: _ALL supports all platforms, _WIN only supports Windows, and _UNIX only supports Linux. So at the start point all additions of KiTTY inside the stock PuTTY code are Windows only. And you can try to replace/convert/patch some of them to _ALL. I suggest to mark this as the first step. You agree?

Regards.

ghost commented 4 years ago

What just replying to a valid question of Cyd

Otherwise, yeah the naming template looks better, good idea I think this would help to sort out things.

That's cool you plane to bring things to your code if they are supported but you know if you choose to keep Windows only anyway you can, I'm not urging you or requesting you to changes things, if you hate Linux and multiplatform, hate it, no problem.

I did not create the ticket to suggest you to changes things, just to get a bit more informations about it so I can publish patch on Arch Linux AUR repo, and user get the software automatically compiled and upgraded all that synched with your Github commits.

lars18th commented 4 years ago

Hi @ArnaudDovi ,

Two comments to clarify:

  1. I'm not member of the developer team of KiTTY. I'm only doing some personal support. Nothing more. The main developer is @cyd01 and it corresponds to him to accept/reject these suggestions.

  2. I suggest to stop commenting about arguments to make peace. Every developer is different. So I don't want to convince others to use or not some technology. However, if KiTTY can be supported in Linux then this (I think) is a positive goal.

Finally, regarding the patches that you can provide, I suggest this simple approach: fork the KiTTY github repo and upload to them your changes. Then create a PR. I feel then @cyd01 will want to approve it and merge it to the main repo (perhaps in a different branch, I'm not sure). And in this case your contribution to the Arch Linux AUR repo will can point directly to the main github repository. I feel this will be more productive.

Regards.

lars18th commented 4 years ago

if you hate Linux and multiplatform, hate it, no problem.

Personally, I love Linux. However, I use Windows as desktop... with KiTTY as Terminal (for SSH, CMD, Cygwin, WSL, etc.) and with one X-Windows server running for non-Windows GUI applications (and with Total Commander/Midnight Commander/Far manager as File Manager; and Chrome as Browser). And all my Windows desktops have SSH enabled. Then I love multiplatform. :laughing:

ghost commented 4 years ago

Good idea yes changes are so big it is probably best to track this with Git.

Personally, I love Linux. However, I use Windows as desktop... with KiTTY as Terminal (for SSH, CMD, Cygwin, WSL, etc.) and with one X-Windows server running for non-Windows GUI applications (and with Total Commander/Midnight Commander/Far manager as File Manager; and Chrome as Browser). And all my Windows desktops have SSH enabled. Then I love multiplatform. laughing

Personally I recently switched to Linux at work and home So it has probably changed my point of view of it too, the level of customization and stability Linux brings over Windows is probably the reason I will never return to Win.

Thanks again for your support

ghost commented 4 years ago

Is it possible to give informations what the following flags do to help me understand all the features

lars18th commented 4 years ago

Hi @ArnaudDovi ,

It's not difficult:

In any case, perhaps a centralized archive with all of this defined and commented can be profitable. What you think @cyd01 about this idea?

ghost commented 4 years ago

Would help yeah, some options speak for themselves, but FDJ, PERSO, TUTTY, RUTTY, PUTTYX, WTS, hard to understand

lars18th commented 4 years ago

Would help yeah, some options speak for themselves, but FDJ, PERSO, TUTTY, RUTTY, PUTTYX, WTS, hard to understand

To my knowledge:

And regarding the DOCUMENTATION of these defines I suggest to include some comments in the file kitty.h in the form // #define MOD_PERSO : Used for .... Example:

#ifndef KITTY_H
#define KITTY_H
#include <math.h>
#include <sys/types.h>
#include <process.h>
#include <time.h>

/*****************************************************
** DEFINES OF THE PROJECT KiTTY
*****************************************************/

// #define MOD_PERSO : Used for ...
//

// #define FDJ : Used for ...
//

// #define MOD_ADB : Used for ...
//

// #define MOD_BACKGROUNDIMAGE : Used for ...
//

[...]

// Handle sur la fenetre principale
extern HWND MainHwnd ;

Do you agree @cyd01 ?

cyd01 commented 4 years ago

Waou so much passion ! First let's share some history.

I've started to work on PuTTY in 2003 with the version 0.53 of the project. At that time, no source management solution (no git, svn, cvs or any other). Remember I was not a developer. I was an ops that need a software to connect servers through telnet (yes!). I liked PuTTY but I though features were missing. My first need was to automate the password negotiation on solaris or hp-ux servers: no Linux one ... and no GUI. The second need was to be able to define a specific icon for each terminal window ... the story has begun. That was the creation of MOD_PERSO patch (called PERSOPORT at this time). My fork was build directly on my desktop computer (under Windows and GCC) and my work remains into a directory on my professional machine, nothing else.

Each time a new PuTTY version was released I worked to merge it with my modifications. In 2006 I've started to share my work. That was the creation of the KiTTY web site with the version 0.58. After that version, people that found KiTTY useful began to ask for integration with other PuTTY forks (LePuTTY, PuTTYTray, TuTTY, RuTTY ...). Here began **MOD_* patches. The KiTTY source files were now downloadable from the web site: a simple .tar.gz** file that is always available here. KiTTY became more and more popular and many requests were integrated.

In 2010 I've started to use a version control system to be able to trace all the modifications I've made. In my company we used subversion and the very first versioned KiTTY version was 0.60.66.30.

Late in 2013 the 0.63 PuTTY version was released. It was a big bang. The internal session settings structure was completely rewritten. It was a huge work to accomplish the merge with KiTTY. I've decided that I need help to maintain KiTTY in the future. Few months after, I've decided to share not only the source code, but the version control system too. That was the beginning of svn on my web site in 2015.

Finally in 2018 I've switch to git with version 0.70, and this Gihub repository opened in october the same year.

Version 0.71 was another revolution. Some of the MOD_* patches, I did not write (remember I've merge them), became broken by the last PuTTY release and I had to sacrifice some of them (cygterm, background image ...). I've asked for some help, and decided to switch completely to English (web site, comment, release notes ...) in early 2019. At mid 2019 I abandoned the old multi-language version of the web site to the current English-only one, based on markdown files.

Now, why not to make KiTTY compatible with Linux. First because in 2003 I simply did not think of it. Second, like I wrote, I'm not the author of all KiTTY patches, and I don't know if they are all compatible. And last, I am also a KiTTY user and I use KiTTY on Windows machine only (remember it is the only platform that does not have a ssh client in standard). When I am on a Linux GUI, I simply use ssh to jump to other machine. So I won't work on the Linux compatibility: I don't even know how to achieve it, and I really don't have time to make it. KiTTY is not my real job even if I really like to work on it.

Anyway I will try to add all the comments people need to understand my modifications. I agree with you @lars18th, I could add some generic informations to kitty.h file.

And above all, I've never refused to merge interesting patch in KiTTY ... but the fact is that along these 13 years I don't receive much help. I think people often mix open source with free software. Anyway feel free to propose such a patch.

All the best Cyd

ghost commented 4 years ago

Thank you Cyd for the history, indeed from this point of view I understand, this is not really a project you initiated these days but something on you made your best to maintain it over years so impossible to predict the futur.

It is very possible that Linux support was not even probably in PuTTY when you first initiated the fork.

Thanks again for the infos.

ghost commented 4 years ago

Well I think for now I will close this issue, I took a lot of your time and you answered everything I was wondering about and the information you provided might interest others who miss KiTTY. That was cool to know how did you bring all that since PuTTY, If I get something running I will for sure share with you.

but I think indeed the need of KiTTY under a Linux env is low, yet I'm enjoying the efficiency of setting up the ssh site informations in the openssh client configuration ~/.ssh/config

This gives the advantage of being able to use the desktop terminal as a remote terminal with "ssh site", passwordless connections with local certificates and to file transfer, most File manager now today supports sftp:// or scp://, so the whole desktop is an efficient client already, and sites recorded in ~/.ssh/config could be read and understood on any system openssh capable so that's a big plus.