Replies: 4 comments 24 replies
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
-
@emillon I think it is an issue with dune: maybe the new mode should be redesigned, and at very least the problematic Unicode characters must be replaced and more documentation should be added. My concern implies that changes need to be made. However, I agree that we don't have a consensus on what exactly should be done yet, so maybe a discussion is indeed more appropriate. I believe (or hope) there will be actionable items generated from this discussion. |
Beta Was this translation helpful? Give feedback.
-
I agree that there is not much documentation available so hopefully I can clear some things up. I've been meaning to write some documentation on TUI eventually so this might be a good place to start. What is the TUI mode?The Dune TUI (terminal user interface) is intended to be an easy-to-use, portable and interactive alternative to the usual command-line usage of Dune. What does it do?Today in 3.11 you can click on messages to minimise them, open up a help screen, resize your window as you like, scroll through messages, and quit using What are the plans for the future?The current features seem limited, and that's OK. Hence why we marked TUI as "experimental" in the 3.11.0 change log. The current feature I am working on that will build on TUI is the jobs tab: This will allow the users to view the status of processes that Dune is running and interact with them appropriately. In order to not have such a wide feature disparity with regular Dune commands, we also wish to implement a subset of the functionality for regular the We have all sorts of other ideas like:
Each of these will have their own specific features soon, but for the time are working on them one-at-a-time. How does it work?The UI is based on the Notty library and allows us to draw images easily without worrying too much about rendering considerations within Dune. It also uses nottui from lwd which provides support for UI elements based on Notty. In the first release of TUI back in 3.8.0, we drew the exact same thing as GUI frameworks have been around for years; Why do all this in the terminal?The main answer is portability. We would like Dune to:
It's very difficult to find a GUI framework that meets these two requirements. Any sophisticated GUI framework will have a library that needs to be depended on, and simpler frameworks tend to be lacking in cross-platform support. There are likely two things that anybody running Dune has: A terminal and a web browser. Both of these options satisfy our constraints and we have chosen to go with the first since that's how everybody is running Dune already. It is also probably more familiar to programmers and light weight compared to spinning up a browser. Another advantage of having a terminal based application is that it becomes easy to use Dune via other modes of interaction such as TUI is also very suitable for usage in a terminal multiplexer such as tmux. How does this interact with VSCode/OCaml Platform/LSP?The TUI mode is not meant to replace any LSP functionality but only to compliment it. As more features get added it can pave the way for similar features to be added elsewhere. In the future, Dune will probably become based more on RPC which means that regular users will interact with it in the command line less frequently, instead interacting via LSP to build, run tests, promote files etc. In that world, it makes sense to have a way to connect to a running Dune process which is what Where TUI is really useful is for Dune/OCaml specific features that LSP does not support. This allows the feature to be implemented once for Dune rather than leaving it to the other LSP clients to additionally support. What are some other examples of other TUI applications?My go to example would be lazygit https://github.com/jesseduffield/lazygit which also has some similar design constraints to us. It is essentially an interactive git client that runs in your terminal and is meant to be easy to use. For more examples on GitHub see here: https://github.com/rothgar/awesome-tuis |
Beta Was this translation helpful? Give feedback.
-
Hi, I was curious about
dune build --watch --display tui
when I saw 3.11 is out, but then got confused about its purpose after trying it. What do I gain besidesdune build --watch
? It seems I cannot do anything more than that. I checked through GitHub issues tagged withtui
and became more puzzled. It seems the leading developer of this feature is targeting the integrated terminal inside VS Code (see #8770), and maybe there are plans to tighten the integration with the editor. However, if we are already inside VS Code, wouldn't it be easier to use LSP instead? What's the goal of this new TUI mode within VS Code? I failed to find more information from the changelog and the codebase, and felt I must have missed something here.PS: There are also some Unicode issues: It assumes
᚛
,―
, and᚜
will always align, but that's not the case in my terminal font (and nothing in the Unicode standard implies they should). It also seems to assume the box drawing characters with "Ambiguous" East Asia width always have the visual width of one cell, which is unfortunately not true, either, and that's why they are "Ambiguous". However, before trying to fix the character choice, I feel it's more important to understand the goal of the TUI mode.Beta Was this translation helpful? Give feedback.
All reactions