From 232c3b29fd85f826bc40598677c823bc33cb7749 Mon Sep 17 00:00:00 2001 From: cyd01 Date: Mon, 30 Nov 2020 19:33:29 +0100 Subject: [PATCH] Tagging the 0.74.3.2 release of the kitty project. --- 0.74_My_PuTTY/config.c | 2 + 0.74_My_PuTTY/dialog.c | 1 - 0.74_My_PuTTY/version.h | 2 +- 0.74_My_PuTTY/windows/MAKEFILE.MINGW | 5 +- 0.74_My_PuTTY/windows/version_minor.txt | 2 +- 0.74_My_PuTTY/windows/window.c | 25 +++++++- blocnote/notepad.a | Bin 31396 -> 32244 bytes blocnote/notepad.c | 16 +++-- docs/pages/CommandLine.md | 7 +++ docs/pages/cygtermd.md | 28 +++------ docs/version.txt | 2 +- kitty.c | 23 ++++--- kitty.h | 1 + kitty_win.c | 80 ++++++++++++++++++++++-- kitty_win.h | 4 +- 15 files changed, 150 insertions(+), 48 deletions(-) diff --git a/0.74_My_PuTTY/config.c b/0.74_My_PuTTY/config.c index 9df2ceb..743076d 100644 --- a/0.74_My_PuTTY/config.c +++ b/0.74_My_PuTTY/config.c @@ -2355,6 +2355,7 @@ void setup_config_box(struct controlbox *b, bool midsession, ssd->editbox = ctrl_editbox(s, "Saved Sessions/New Folder", 'e', 100, HELPCTX(session_saved), sessionsaver_handler, P(ssd), P(NULL)); + ssd->editbox->generic.column = 0; if( !midsession && ( (get_param("INIFILE")!=2)||(!GetDirectoryBrowseFlag()) ) ) { ssd->clearbutton = ctrl_pushbutton(s, "Clear", NO_SHORTCUT, @@ -2381,6 +2382,7 @@ void setup_config_box(struct controlbox *b, bool midsession, ssd->listbox->generic.column = 0; #ifdef MOD_PERSO ssd->listbox->listbox.height = GetConfigBoxHeight() ; + ssd->listbox->listbox.hscroll = true ; /* Does nothing */ #else ssd->listbox->listbox.height = 7; #endif diff --git a/0.74_My_PuTTY/dialog.c b/0.74_My_PuTTY/dialog.c index 2c83f10..09e1399 100644 --- a/0.74_My_PuTTY/dialog.c +++ b/0.74_My_PuTTY/dialog.c @@ -352,7 +352,6 @@ union control *ctrl_listbox(struct controlset *s, const char *label, c->listbox.percentwidth = 100; c->listbox.ncols = 0; c->listbox.percentages = NULL; - c->listbox.hscroll = true; return c; } diff --git a/0.74_My_PuTTY/version.h b/0.74_My_PuTTY/version.h index c9f4b5b..55d3a36 100644 --- a/0.74_My_PuTTY/version.h +++ b/0.74_My_PuTTY/version.h @@ -1,5 +1,5 @@ #define RELEASE 0.74 #define TEXTVER "Release 0.74" #define SSHVER "-Release-0.74" -#define BINARY_VERSION 0,74,3,1 +#define BINARY_VERSION 0,74,3,2 #define SOURCE_COMMIT "unavailable" diff --git a/0.74_My_PuTTY/windows/MAKEFILE.MINGW b/0.74_My_PuTTY/windows/MAKEFILE.MINGW index 5e66485..267bd8f 100644 --- a/0.74_My_PuTTY/windows/MAKEFILE.MINGW +++ b/0.74_My_PuTTY/windows/MAKEFILE.MINGW @@ -1854,7 +1854,7 @@ winpgnt_integrated.o: ../windows/winpgnt.c ../putty.h ../ssh.h ../misc.h ../tree adb.o: ../putty.h ../../adb/adb.c $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../../adb/adb.c -I../../adb -I../../ -kitty.o: ../../kitty.c ../../kitty.h ../../kitty_savedump.c ../../kitty_launcher.c ../../kitty_launcher.h ../windows/window.c ../../kitty_ini.h +kitty.o: ../../kitty.c ../../kitty.h ../../kitty_savedump.c ../../kitty_launcher.c ../../kitty_launcher.h ../windows/window.c ../../kitty_ini.h ../../kitty_help.h $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../../kitty.c \ -DBUILD_TIME=`date +'"%d/%m/%Y-%H:%M:%S(%Z)"'` \ -DBUILD_VERSION=`cat version_major.txt` \ @@ -1982,6 +1982,9 @@ kitty.dll: ../../kitty_dll.c kitty_dll.res.o ../../kitty_ini.h: ../../kitty_ini.txt ( printf 'static char *default_init_file_content = "' ; sed 's/\\/\\\\/g' ../../kitty_ini.txt | sed 's/$$/\\n\\/' ; printf '" ;\n' ) > ../../kitty_ini.h +../../kitty_help.h: ../../docs/pages/CommandLine.md + ( printf 'static char *default_help_file_content = "' ; sed -n '/CmdLineOptions_begin/,/CmdLineOptions_end/p' ../../docs/pages/CommandLine.md|sed 's///'|sed 's/\*\*//g'|sed 's/$$/\\r\\n\\/' ; printf '" ;\n' ) > ../../kitty_help.h + nohyperlink: putty_nohyperlink.exe notrans: putty_notrans.exe diff --git a/0.74_My_PuTTY/windows/version_minor.txt b/0.74_My_PuTTY/windows/version_minor.txt index d00491f..0cfbf08 100644 --- a/0.74_My_PuTTY/windows/version_minor.txt +++ b/0.74_My_PuTTY/windows/version_minor.txt @@ -1 +1 @@ -1 +2 diff --git a/0.74_My_PuTTY/windows/window.c b/0.74_My_PuTTY/windows/window.c index 5a46bd4..bab97f1 100644 --- a/0.74_My_PuTTY/windows/window.c +++ b/0.74_My_PuTTY/windows/window.c @@ -965,7 +965,12 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) if( existfile(argv[i]) ) { LoadFile = (char*) malloc( strlen(argv[i])+1 ) ; strcpy( LoadFile, argv[i] ) ; + RunPuttyEd( hwnd, LoadFile, true ) ; + free( LoadFile ) ; + } else { + MessageBox(hwnd,"Unable to find requested file","Error",MB_OK|MB_ICONERROR) ; } + exit( 0 ) ; } else if( !strcmp(p, "-folder") ) { char *pfolder ; pfolder=p+7; @@ -1110,9 +1115,19 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) sprintf(buffer, "%s|%s|0", (char*)get_param_str("INI"), (char*)get_param_str("SAV") ) ; return Notepad_WinMain(inst, prev, buffer, show) ; } else if( !strcmp(p, "-edb") ) { - char buffer[1024]; i++; - sprintf(buffer, "%s|%s|%s", (char*)get_param_str("INI"), (char*)get_param_str("SAV"), argv[i] ) ; + if( existfile(argv[i]) ) { + char buffer[1024]; + sprintf(buffer, "%s|%s|%s", (char*)get_param_str("INI"), (char*)get_param_str("SAV"), argv[i] ) ; + return Notepad_WinMain(inst, prev, buffer, show) ; + } else { + MessageBox(hwnd,"Unable to find requested file","Error",MB_OK|MB_ICONERROR) ; + } + exit(0); + } else if( !strcmp(p, "-help") ) { + SetTextToClipboard(GetHelpMessage()) ; + char buffer[1024]; + sprintf(buffer, "%s|%s|2", (char*)get_param_str("INI"), (char*)get_param_str("SAV") ) ; return Notepad_WinMain(inst, prev, buffer, show) ; #ifdef MOD_LAUNCHER } else if( !strcmp(p, "-launcher") ) { @@ -3318,7 +3333,11 @@ else if((UINT_PTR)wParam == TIMER_INIT) { // Initialisation char buffer[4096] = "" ; // On charge automatiquement au démarrage (-edit) un fichier dans l'editeur connecté - if( !PuttyFlag ) if( LoadFile!=NULL ) { RunPuttyEd( hwnd, LoadFile ) ; free( LoadFile ) ; LoadFile = NULL ; } + if( !PuttyFlag ) if( LoadFile!=NULL ) { + RunPuttyEd( hwnd, LoadFile, true ) ; + free( LoadFile ) ; + LoadFile = NULL ; + } if( (conf_get_int(conf,CONF_protocol) == PROT_SSH) && (!is_backend_connected) ) break ; // On sort si en SSH on n'est pas connecte // Lancement d'une (ou plusieurs separees par \\n) commande(s) automatique(s) a l'initialisation diff --git a/blocnote/notepad.a b/blocnote/notepad.a index 6b59cdaba1450852752e079d662a3d7c7d7f1bc7..fcf485de1cc926bb87555a4a17e7e573e80924cd 100644 GIT binary patch delta 6983 zcmZ4TmGR4O#tD*~W(H>FW(EdkmK&8eGa-1B?=gvsnj4#$D}X=(mk%Qw0|lLSQR!ojM+`Fft7*5 z#D;-kOBh&|!EEwcW@*MPlTR`$b6sI(V7TGPz;GdA@;BzAs;e0p7`j~r__r~%9N=%6 z3+C~3vZ%ZO>1=+((t3cu<;>&1>$YSaGp?-weBMTO-!i%P@h z0s$jN#toYn3tBR=h6OjiS+M!OkSrr3)8xOx28@d*>xtBezGGux0Ea`T>yzUwD%ENX z3@=(H?-wy;^qc%uM3+|qWU7k_&v6$Ojzg0fMP=CHK}tSN4iwd8JTkdnRF`qu|aTjOQm;Na!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Z%(A6qcwlFjRvR;XXA;UsHtP zjvCCV57l4|&o62W47Ff&Lh1|*bzqi*I;aN(>U>RCht(F$8ZeUuH5eG`8^8+XH5eEg z!7NJ+Se|u+vwSsRMacvWSnk~dmp!Y&z|aKNYpMxzprosBhrbC(x46R_n3z`fJZD7_tO_;M3wO|&zYQY>Br^Ud~4pz5Li-Dm7%(@F_ zv1`M`M70?hI>EA_{w<^frN97b4^O@keb1PK8Nv}^(15c%;H(@ts|U{7F!^Q7b>Unl z1_nk31qLRNxeVJG7#J2zz8o7F9m&cVpQFohLaM2wMvL5m$(M4gd=;TejE1tSAP z2nVtnH%0~qmdWjL%Br6^k;O|vD!GtFni&}wnkJu*`_0%l`E_#RAhG-3B zk^M{z3_nmr&N4ADywOBfbC-#Mp>uL{f;6kVHUq=*$<+zzObb{hE9#3({*hqBcw)15 z;xcv?BTEy@$zn`_iW#mcnI(G0MwS*P4DmT>V3sLEe1=0)&&(!strcmp(LoadFile,"2")) ) { + hEdit = CreateWindow("edit", "", WS_CHILD | WS_VISIBLE | ES_READONLY | + ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL, + 0, 0, 0, 0, hwnd, NULL, notepad_hinst, NULL); + strcpy(LoadFile,"1"); + } else { + hEdit = CreateWindow("edit", "", WS_CHILD | WS_VISIBLE | + ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL, + 0, 0, 0, 0, hwnd, NULL, notepad_hinst, NULL); + } ZeroMemory(&lf, sizeof(LOGFONT)); lstrcpy(lf.lfFaceName,"Courier"); diff --git a/docs/pages/CommandLine.md b/docs/pages/CommandLine.md index 33cae1c..49d7f4d 100644 --- a/docs/pages/CommandLine.md +++ b/docs/pages/CommandLine.md @@ -1,6 +1,8 @@
## New command-line options + + In **KiTTY** some new command-line options are available: * **-auto-store-sshkey**: automatically store server SSH key without prompting @@ -14,6 +16,7 @@ In **KiTTY** some new command-line options are available: * **-fileassoc**: associate **.ktx** files with **KiTTY**. See [Portability feature](Portability.md) to define file extention * **-folder**: directly open a specific folder (for [savemode=dir mode](Portability.md) only). It must precede **-load** option * **-fullscreen**: start directly in full screen mode +* **-help**: print this help message * **-icon**: choose a specific [build-in icon](kitty_icon.md) * **-iconfile**: choose an external icon file * **-initdelay**: delay (in seconds) before initial configured actions (send to tray, autocommand ...). Default is 2.0 @@ -48,3 +51,7 @@ In **Klink** there is one of the **KiTTY** option: In **Kageant** there is only one: * **-pass**: to set the passphrase of the ssh key to add + + + +> All original **PuTTY** command-line options are available on [PuTTY website](https://the.earth.li/~sgtatham/putty/latest/htmldoc/Chapter3.html#using-cmdline) diff --git a/docs/pages/cygtermd.md b/docs/pages/cygtermd.md index 355707d..801c685 100644 --- a/docs/pages/cygtermd.md +++ b/docs/pages/cygtermd.md @@ -1,4 +1,3 @@ -
## About cygtermd, the PuTTYCyg workaround @@ -13,44 +12,35 @@ Download it and put it into your **/bin** Cygwin directory. This feature is also available directly from the command-line. Once the **cygtermd.exe** is put into the **Cygwin** directory just call this command: ``` -kitty.exe -localproxy "C:\cygwin64\bin\cygtermd.exe /home/%USERNAME% /bin/bash -login" localhost +kitty.exe -localproxy 'C:\cygwin64\bin\cygtermd.exe /home/cyd /bin/bash -login' localhost ``` -Adapt **C:\cygwin64\bin\cygtermd.exe** if it has been installed to a different directory. You must provide a target hostname (ex: localhost) even if it is not used in this situation. - -If you are running this command from PowerShell rather than a Windows shortcut, Start➡Run, or a regular command prompt, you should use single quotes instead of double quotes. -``` -kitty.exe -localproxy 'C:\cygwin64\bin\cygtermd.exe /home/%USERNAME% /bin/bash -login' localhost -``` +Adapt **C:\cygwin64\bin\cygtermd.exe** and **/home/cyd** with your own settings. You must provide a target hostname (ex: localhost) even if it is not used in this situation. + ### Start a **CMD.EXE** into a **KiTTY** terminal It is possible to start directly the Windows command line utility **cmd.exe**: ``` -kitty.exe -localproxy "C:\cygwin64\bin\cygtermd.exe /cygdrive/c/Windows /cygdrive/c/Windows/System32/cmd.exe" localhost +kitty.exe -localproxy 'C:\cygwin64\bin\cygtermd.exe /cygdrive/c/Windows /cygdrive/c/Windows/System32/cmd.exe' localhost ``` -Don't forget to choose the right codepage in translation tab or use the **-codepage** command line option. +Don't forget to choose the rigth codepage in translation tab or use the **-codepage** command line option. -It is not necessary to have the full **Cygwin** environment to do this. Just add the **cygtermd.exe** file and the corresponding **cygwin1.dll** library next the **kitty.exe** binary. +It si not necessary to have the full **Cygwin** environment to do this. Just add the **cygtermd.exe** file and the corresponding **cygwin1.dll** library next the **kitty.exe** binary. ### Use **winpty** to start **cmd.exe** or ** PowerShell** Windows utilities -It is also possible to start the Windows command line utility **cmd.exe** from the [winpty tool](https://github.com/rprichard/winpty): +It is also possible to start the Windows command line utility **cmd.exe** from de [winpty tool](https://github.com/rprichard/winpty): Get it and unzip it into your **/usr** Cygwin directory. Then run ``` -kitty.exe -localproxy "C:\cygwin64\bin\cygtermd.exe /usr/bin/winpty.exe C:\Windows\System32\cmd.exe" localhost +kitty.exe -localproxy 'C:\cygwin64\bin\cygtermd.exe /cygdrive/c/Windows /usr/bin/winpty.exe /cygdrive/c/Windows/System32/cmd.exe' localhost ``` And now use it to run **PowerShell**: ``` -kitty.exe -localproxy "C:\cygwin64\bin\cygtermd.exe /usr/bin/winpty.exe C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" localhost -``` - -or **PowerShell 7**: -``` -kitty.exe -localproxy "C:\cygwin64\bin\cygtermd.exe /usr/bin/winpty.exe C:\Program Files\PowerShell\7\pwsh.exe" localhost +kitty.exe -localproxy 'C:\cygwin64\bin\cygtermd.exe /cygdrive/c /usr/bin/winpty.exe /cygdrive/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe' localhost ``` --- diff --git a/docs/version.txt b/docs/version.txt index 7584334..9243766 100644 --- a/docs/version.txt +++ b/docs/version.txt @@ -1 +1 @@ -0.74.3.1 \ No newline at end of file +0.74.3.2 \ No newline at end of file diff --git a/kitty.c b/kitty.c index d661f33..dea83ac 100644 --- a/kitty.c +++ b/kitty.c @@ -1246,7 +1246,12 @@ void CountUp( void ) { WriteParameter( INIT_SECTION, "KiLic", buffer) ; } } - + +#include "../../kitty_help.h" +char * GetHelpMessage(void) { + return default_help_file_content ; +} + // Si le fichier kitty.ini n'existe pas => creation du fichier par defaut #include "kitty_ini.h" void CreateIniFile( const char * filename ) { @@ -5005,22 +5010,20 @@ int ManageShortcuts( HWND hwnd, const int* clips_system, int key_num, int shift_ if( key == shortcuts_tab.editor ) { // Lancement d'un putty-ed if( debug_flag ) { debug_logevent( "Start empty internal editor" ) ; } - RunPuttyEd( hwnd, NULL ) ; + RunPuttyEd( hwnd, NULL, false ) ; return 1 ; } if( key == (shortcuts_tab.editorclipboard ) ) { // Lancement d'un putty-ed qui charge le contenu du presse-papier if( debug_flag ) { debug_logevent( "Start internal editor fullfiled with clipboard" ) ; } - term_copyall(term,clips_system,lenof(clips_system)) ; RunPuttyEd( hwnd, "1" ) ; + term_copyall(term,clips_system,lenof(clips_system)) ; RunPuttyEd( hwnd, "1", false ) ; return 1 ; - } - else if( key == shortcuts_tab.winscp ) // Lancement de WinSCP - { SendMessage( hwnd, WM_COMMAND, IDM_WINSCP, 0 ) ; return 1 ; } - else if( key == shortcuts_tab.autocommand ) // Rejouer la commande de demarrage - { + } else if( key == shortcuts_tab.winscp ) { // Lancement de WinSCP + SendMessage( hwnd, WM_COMMAND, IDM_WINSCP, 0 ) ; return 1 ; + } else if( key == shortcuts_tab.autocommand ) { // Rejouer la commande de demarrage RenewPassword( conf ) ; SetTimer(hwnd, TIMER_AUTOCOMMAND,autocommand_delay, NULL) ; - return 1 ; } - if( key == shortcuts_tab.print ) { // Impression presse papier + return 1 ; + } if( key == shortcuts_tab.print ) { // Impression presse papier SendMessage( hwnd, WM_COMMAND, IDM_PRINT, 0 ) ; return 1 ; } diff --git a/kitty.h b/kitty.h index 7b49de5..a207950 100644 --- a/kitty.h +++ b/kitty.h @@ -402,6 +402,7 @@ void ChangeFontSize(HWND hwnd, int dec) ; void create_settings( const char * name ) ; void SetHostKeyExtension( const char* ext ) ; +char * GetHelpMessage(void) ; void CreateIniFile( const char * filename ) ; void SendKeyboard( HWND hwnd, const char * buffer ) ; char * GetRemotePath() ; diff --git a/kitty_win.c b/kitty_win.c index eca7066..002cd89 100644 --- a/kitty_win.c +++ b/kitty_win.c @@ -396,16 +396,18 @@ void RunCommand( HWND hwnd, const char * cmd ) { } } -void RunPuttyEd( HWND hwnd, char * filename ) { +void RunPuttyEd( HWND hwnd, char * filename, bool readonly ) { char buffer[1024]="", shortname[1024]="" ; - if( GetModuleFileName( NULL, (LPTSTR)buffer, 1023 ) ) - if( GetShortPathName( buffer, shortname, 1023 ) ) { + if( GetModuleFileName( NULL, (LPTSTR)buffer, 1023 ) ) if( GetShortPathName( buffer, shortname, 1023 ) ) { strcat( shortname, " -ed" ); - if( filename!=NULL ) if( strlen(filename)>0 ) { strcat( shortname, "b " ) ; strcat( shortname, filename ) ; } + if( filename!=NULL ) if( strlen(filename)>0 ) { + strcat( shortname, "b " ) ; + strcat( shortname, filename ) ; + } debug_logevent( shortname ) ; RunCommand( hwnd, shortname ) ; - } - } + } +} // Verifie si une mise a jour est disponible sur le site web extern char BuildVersionTime[256] ; @@ -454,3 +456,69 @@ void PopUpSystemMenu( HWND hwnd, int npos ) { } } + +// Description: +// Creates a tooltip for an item in a dialog box. +// Parameters: +// idTool - identifier of an dialog box item. +// nDlg - window handle of the dialog box. +// pszText - string to use as the tooltip text. +// Returns: +// The handle to the tooltip. +// +HWND CreateToolTip(int toolID, HWND hDlg, PTSTR pszText) +{ + if (!toolID || !hDlg || !pszText) + { + return FALSE; + } + // Get the window of the tool. + HWND hwndTool = GetDlgItem(hDlg, toolID); + + // Create the tooltip. g_hInst is the global instance handle. + HWND hwndTip = CreateWindowEx((DWORD)NULL, TOOLTIPS_CLASS, NULL, + WS_POPUP |TTS_ALWAYSTIP | TTS_BALLOON, + CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, CW_USEDEFAULT, + hDlg, NULL, + hinst /*g_hInst*/, NULL); + + if (!hwndTool || !hwndTip) + { + return (HWND)NULL; + } + + // Associate the tooltip with the tool. + TOOLINFO toolInfo = { 0 }; + toolInfo.cbSize = sizeof(toolInfo); + toolInfo.hwnd = hDlg; + toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS; + toolInfo.uId = (UINT_PTR)hwndTool; + toolInfo.lpszText = pszText; + SendMessage(hwndTip, TTM_ADDTOOL, 0, (LPARAM)&toolInfo); + + return hwndTip; +} + +HWND CreateToolTip2(int toolID, HWND hDlg, PTSTR pszText) { + HWND hwndToolTips = CreateWindow(TOOLTIPS_CLASS, NULL, + WS_POPUP | TTS_NOPREFIX | TTS_BALLOON, + 0, 0, 0, 0, NULL, NULL, GetModuleHandle(NULL), NULL); + if (hwndToolTips) +{ + TOOLINFO ti; + + ti.cbSize = sizeof(ti); + ti.uFlags = TTF_TRANSPARENT | TTF_CENTERTIP; + ti.hwnd = hDlg; + ti.uId = toolID; + ti.hinst = NULL; + ti.lpszText = pszText; + + GetClientRect(hwnd, &ti.rect); + + SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM) &ti ); + +} +return hwndToolTips ; +} diff --git a/kitty_win.h b/kitty_win.h index 1008be5..9d8b29e 100644 --- a/kitty_win.h +++ b/kitty_win.h @@ -29,7 +29,7 @@ int SetTextToClipboard( const char * buf ) ; void RunCommand( HWND hwnd, const char * cmd ) ; // Démarre l'éditeur embarqué -void RunPuttyEd( HWND hwnd, char * filename ) ; +void RunPuttyEd( HWND hwnd, char * filename, bool readonly ) ; // Verifie si une mise a jour est disponible sur le site web void CheckVersionFromWebSite( HWND hwnd ) ; @@ -40,4 +40,6 @@ void debug_logevent( const char *fmt, ... ) ; // Affiche le menu system de l'application void PopUpSystemMenu( HWND hwnd, int npos ) ; +// Affiche une bulle tooltip +HWND CreateToolTip(int toolID, HWND hDlg, PTSTR pszText) ; #endif