far2l icon indicating copy to clipboard operation
far2l copied to clipboard

Added fish shell support

Open unxed opened this issue 1 month ago • 11 comments

Isolated the code for different shells; this will serve as a foundation for adding nu, etc.

@tempergate pls test!

Touch #2913 #1264

unxed avatar Nov 24 '25 09:11 unxed

Autocomplete still WIP

unxed avatar Nov 24 '25 17:11 unxed

было бы замечательно если бы ИИ делал правки локализованно, а не переколбашивал прям все сразу...

elfmz avatar Nov 24 '25 19:11 elfmz

Isolated the code for different shells; this will serve as a foundation for adding nu, etc.

@tempergate pls test!

Touch #2913 #1264

seems works correctly now

tempergate avatar Nov 24 '25 19:11 tempergate

было бы замечательно если бы ИИ делал правки локализованно, а не переколбашивал прям все сразу...

Так тут осознанный рефакторинг чтобы вытащить всё, что связано с различием шеллов, в отдельный файл. Иначе адская мешанина из if'ов. Это задел чтобы потом и другие шеллы несложно добавлять было

unxed avatar Nov 25 '25 04:11 unxed

ну просто.. image

elfmz avatar Nov 25 '25 08:11 elfmz

Что вы, какие агенты)) Агенты тупые. Я по старинке использую чат в aistudio.google.com, где прошу сетку рубить работу на простые и понятные части, генерируя по одному небольшому патчику за раз в специально придуманном мной для этого формате

Просто поскольку приношу уже финал, иногда кажется что много и запутанно

unxed avatar Nov 25 '25 08:11 unxed

ну вот немного офтоп, но вот топчик цикломатической сложности Editor.cpp:

~/projects/far2l/far2l/src$ pmccabe ./editor.cpp |sort -g| tail -10
27      27      43      5586    71      ./editor.cpp(5586): Editor::AddUndoData
28      28      83      5146    151     ./editor.cpp(5146): Editor::DeleteBlock
34      69      114     990     230     ./editor.cpp(990): Editor::VMProcess
37      37      72      3922    129     ./editor.cpp(3922): Editor::DeleteString
61      61      109     3590    188     ./editor.cpp(3590): Editor::ProcessMouse
67      67      167     4052    257     ./editor.cpp(4052): Editor::InsertString
67      67      232     4550    377     ./editor.cpp(4550): Editor::Search
105     139     389     6265    617     ./editor.cpp(6265): Editor::EditorControl
128     128     270     357     530     ./editor.cpp(357): Editor::ShowEditor
435     605     1277    1242    2347    ./editor.cpp(1242): Editor::ProcessKey

Где первая колонка - цикломатическая сложность типа relaxed, вторая - по классической методологии посчитанная. Для понимания глубин:

1-10: Простая процедура с низким риском.
11-20: Более сложная процедура со средним риском.
21-50: Сложная процедура с высоким риском.
>50: Непроверяемый код с очень высоким риском. 

elfmz avatar Nov 25 '25 12:11 elfmz

Ого! Впрочем да, там адок. До нейронок я туда даже лезть боялся, хотя перенос по словам мне лет 10 назад ещё нужен был.

unxed avatar Nov 25 '25 13:11 unxed

@unxed

Что вы, какие агенты)) Агенты тупые.

Agents in general are as smart as given them instructions/rules. If you just ask to do something like build app for something, then you get what @elfmz illustrated: pics

But if you know exactly what you need and how to implement it then agents can do all dirty work (with some given time). It's the same like have a team of 2-3 junior developers with encyclopedic knowledge and phenomenal performance. But you need to explain them what to do. Otherwise they'll do very surprising and crazy things. You have an equal chance of improving or breaking the code.

And you need to understand design and code very well. But the excellent part is AI can explain the code and design to you! Everything has its time eventually, and AI increases productivity more than 50%.

прошу сетку рубить работу на простые и понятные части, генерируя по одному небольшому патчику за раз в специально придуманном мной для этого формате

@unxed It's very cool! But you're wasting your time and talent. Try Cursor AI or Continue.dev.

It's already embedded. All you need is to explain the task with maximum details. All rules are in separate file like AGENTS.md. Example rules (simple human English, Russian, etc): do not create duplicated code always compile code and fix all build errors after your modifications

AI agent can make changes, test it, fix build errors, work with git, actually do everything you can imaging. With MCP servers you can connect unlimited possibilities. Try to use claude-4.5-sonnet (with Cursor IDE for example) and you'll see the difference compared to copy/paste with google AI chats. (However, I don't know which country you are in, so it might be local differences.)

Now I think the most important thing has become to learn how to use and control AI. This example from @elfmz is a good task for AI for refactoring:

вот топчик цикломатической сложности Editor.cpp

yulian5 avatar Nov 27 '25 10:11 yulian5

Thanks for the advice, I've taken it into account. My flaw turned out to be good enough, for example, to implement word wrap in a few days - task everyone has been afraid to tackle since 2016.

I tried Cursor, but the built-in LLM is pretty stupid and free limit is not so big, and I had no motivation to use paid options, since AI Studio has a free Gemini 2.5 Pro that perfectly suits my needs. I'm not ready to pay for work on open-source projects.

Copy/paste takes minimal time, and the .ap format has already been refined to a very high level of reliability. And the chat offers great flexibility: no guesswork from the not-so-smart Cursor AI what files to add to prompt automatically, only manual file selection - less errors, better results, also it saves tokens; a huge context window for the entire process (or one logical part), rather than small context windows for each prompt like in AI editors. Plus, I constantly revert parts of the dialogue, edit the AI responses to improve future generation, fork chats, and combine different models usage in a single chat.

I just shared my method, of course you can use the tools that suit you best.

As for the editor refactoring, yes, I've thought about it, but anyway line numbers should be merged first. Also where are several other tasks I am currently working on, like adding osc52 support to GNOME VTE, so I can't promise anything. Editor refactoring is interesting and important, but we'll see how it goes over time. And in any case, my first priority is UX, not code aesthetics, and the editor already seems to have everything we need, so refactoring it isn't urgent.

unxed avatar Nov 27 '25 10:11 unxed

@unxed:

you can use the tools that suit you best.

yulian5 avatar Nov 27 '25 14:11 yulian5