Giter Site home page Giter Site logo

cmang / durdraw Goto Github PK

View Code? Open in Web Editor NEW
659.0 5.0 20.0 5.53 MB

Versatile ASCII and ANSI Art text editor for drawing in the Linux/Unix/macOS terminal, with animation, 256 and 16 colors, Unicode and CP437, and customizable themes

Home Page: http://durdraw.org

License: BSD 3-Clause "New" or "Revised" License

Python 99.33% Shell 0.04% Roff 0.60% Dockerfile 0.04%
ascii-art textmode ansi-art unicode-art text-editor xterm-256color animation ansi ascii bbs

durdraw's Introduction

Durdraw

              __                __
            _|  |__ __ _____ __|  |_____ _____ __ __ __
           / _  |  |  |   __|  _  |   __|  _  |  |  |  |\
          /_____|_____|__|__|_____|__|___\____|________| | 
          \_____________________________________________\|  v 0.27.1

durdraw-0 27 0-demo-4

OVERVIEW

Durdraw is an ASCII, Unicode and ANSI art editor for UNIX-like systems (Linux, macOS, etc). It runs in modern Utf-8 terminals and supports frame-based animation, custom themes, 256 and 16 color modes, terminal mouse input, DOS ANSI art viewing, CP437 and Unicode mixing and conversion, HTML output, mIRC color output, and other interesting features.

Durdraw is heavily inspired by classic ANSI editing software for MS-DOS and Windows, such as TheDraw, Aciddraw and Pablodraw, but with a modern Unix twist.

REQUIREMENTS

  • Python 3 (3.10+ recommended)
  • Linux, macOS, or other Unix-like System

INSTALLATION

You can install from your OS repositories, or follow the instructions below to install from source:

Packaging status

If you just want to run it without instalilng, scroll down to the next section.

1: Download and extract, or use git to download:

   git clone https://github.com/cmang/durdraw.git  
   cd durdraw 

2: Install or upgrade using pip:

    pip install --upgrade .

Or run the installer:

    python3 setup.py install

3: Optionally, install some themes and a sample configuration file for your local user into ~/.durdraw/:

    ./installconf.sh

You should now be able to run durdraw. Press esc-h for help, or try durdraw --help for command-line options.

RUNNING WITHOUT INSTALLING

You can run Durdraw with:

    ./start-durdraw

To look at some included example animations:

    ./start-durdraw -p examples/*.dur

GALLERY

Watch the Tutorial Part 1

Watch another video

durdraw-xmas-example

dopetrans3 durdraw-screenshot durdraw-linux-unicode-ansi eye cm-doge bsd-color-new

COMMAND LINE USAGE

You can play a .dur file or series of .dur files with:

    $ durdraw -p filename.dur
    $ durdraw -p file1.dur file2.dur file3.dur ...

Other command-line options:

usage: start-durdraw [-h] [-p PLAY [PLAY ...]] [-q | -w | -x TIMES] [--256color | --16color] [-b]
                     [-W WIDTH] [-H HEIGHT] [-m] [--nomouse] [-A] [-u UNDOSIZE] [-V] [--debug]
                     [filename]

positional arguments:
  filename              .dur or ascii file to load

optional arguments:
  -h, --help            show this help message and exit
  -p PLAY [PLAY ...], --play PLAY [PLAY ...]
                        Just play .dur file or files, then exit
  -q, --quick           Skip startup screen
  -w, --wait            Pause at startup screen
  -x TIMES, --times TIMES
                        Play X number of times (requires -p)
  --256color            Try 256 color mode
  --16color             Try 16 color mode
  -b, --blackbg         Use a black background color instead of terminal default
  -W WIDTH, --width WIDTH
                        Set canvas width
  -H HEIGHT, --height HEIGHT
                        Set canvas height
  -m, --max             Maximum canvas size for terminal (overrides -W and -H)
  --nomouse             Disable mouse support
  --cursor CURSOR       Cursor mode (block, underscore, or pipe)
  --notheme             Disable theme support
  --theme THEME         Load a custom theme file
  --cp437               Encode extended characters using Code Page 437 (IBM-PC/MS-DOS) encoding
                        instead of Utf-8. (Needs CP437 capable terminal and font)
  --export-ansi         Export loaded art to an ANSI file and exit
  -u UNDOSIZE, --undosize UNDOSIZE
                        Set the number of undo history states - default is 100. More requires more
                        RAM, less saves RAM.
  -V, --version         Show version number and exit

INTERACTIVE USAGE/EDITING

Use the arrow keys (or mouse) and other keys to edit, much like a text editor. You can use the "Esc" (or "Meta") key to access commands:

  .. Art Editing .....................   
  : F1-F10 - insert character        :   
  : esc-up - next fg color           :   
  : esc-down - prev fg color         :   
  : esc-right - next bg color (16c)  :   
  : esc-left - prev bg color         :
  : esc-/ - insert line              :   .. Animation .......................
  : esc-' - delete line              :   : esc-k - next frame               :
  : esc-. - insert column            :   : esc-j - previous frame           :
  : esc-, - delete column            :   : esc-p - start/stop payback       :
  : esc-] - next character group     :   : esc-n - clone frame              :
  : esc-[ - previous character group :   : esc-N - append empty frame       :
  : esc-S - change character set     :   : esc-d - delete frame             :
  : esc-y - eyedrop (pick up color)  :   : esc-D - set frame delay          :
  : esc-l - color character          :   : esc-+/esc-- - faster/slower      :
  : esc-c - color picker             :   : esc-R - set playback/edit range  :
  : shift-arrows - select for copy   :   : esc-g - go to frame #            :
  : esc-K - mark selection           :   : esc-M - move frame               :
  : esc-v - paste                    :   :..................................:
  :..................................:
                                         .. UI/Misc .........................
  .. File Operations .................   : esc-m - main menu                :
  : esc-C - new/clear canvas         :   : esc-t - mouse tools              :
  : esc-o - open                     :   : esc-z - undo                     :
  : esc-s - save                     :   : esc-r - redo                     :
  :..................................:   : esc-V - view mode                :
                                         : esc-i - file/canvas info         :
  .. Canvas Size .....................   : esc-I - character inspector      :
  : esc-" - insert line              :   : tab - focus canvas or colors     :
  : esc-: - delete line              :   : ctrl-l - redraw screen           :
  : esc-> - insert column            :   : esc-h - help                     :
  : esc-< - delete column            :   : esc-q - quit                     :
  :..................................:   :..................................:

                                                            Prev   Next
                                                            Frame  Frame
                                                            |      |
Main   Frame     Speed     Frame   Play/Edit  Mouse   First | Play |  Last
Menu   Number      |       Delay   Range      Tools   Frame | Pause|  Frame
 |     |           |        |       |          |         |  |  |   |  |
[Menu] F: 1/8    <FPS>: 8   D: 0.00 R: 1/8   [Move]      |< << |> >> >|  

CONFIGURATION

You can create a custom startup file where you can set a theme.

If you did not already do so during installation, you can install a sample configuration and some themes into ~/.durdraw/ with the command:

    ./installconf.sh

This will place durdraw.ini into ~/.durdraw/ and the themes into ~/.durdraw/themes/.

Here is an example durdraw.ini file:

; Durdraw 0.20 Configuration File
[Theme]
theme-16: ~/.durdraw/themes/purpledrank-16.dtheme.ini
theme-256: ~/.durdraw/themes/mutedform-256.dtheme.ini

The option 'theme-16' sets the path to the theme file used in 16-color mode, and 'theme-256' sets the theme file used for 256-color mode.

You can also load a custom theme file using the --theme command-line argument and passing it the path to a theme file, or disable themes entirely with the --notheme command line option.

Here is an example 16-color theme:

[Theme-16]
name: 'Purple Drank'
mainColor: 6
clickColor: 3
borderColor: 6
clickHighlightColor: 5
notificationColor: 4
promptColor: 4

and a 256-color theme:

[Theme-256]
name: 'Muted Form'
mainColor: 104
clickColor: 37
borderColor: 236
clickHighlightColor: 15
notificationColor: 87
promptColor: 189
menuItemColor: 189
menuTitleColor: 159
menuBorderColor: 24

The colors and theme options are as follows:

colors for 16-color mode: 1 black 2 blue 3 green 4 cyan 5 red 6 magenta 7 yellow 8 white

color codes numbers for 256-color mode can be found in Durdraw's 256-color selector.

mainColor: the color of most text
clickColor: the color of buttons (clickable items)
clickHighlightColor: the color the button changes to for a moment when clicked
borderColor: the color of the border around a drawing
notificationColor: the color of notification messages
promptColor: the color of user prompt messages
menuItemColor: the color of menu items
menuTitleColor: the color of menu titles
menuBorderColor: the color of the border around menus

OTHER TIPS

* To use themes, copy durdraw.ini to ~/.durdraw/ and edit it. Durdraw
  will also check in the current directory for durdraw.ini.

* The mouse can be used for moving the cursor (even over SSH) and
  clicking buttons, if your terminal supports Xterm mouse reporting.
  In iTerm2 this is under Profiles, Terminal and Terminal Emulation.

OPTIONAL INSTALLATION

For PNG and animated GIF export, install Ansilove (https://ansilove.org/) and make sure it is is in your path. PNG and GIF export only work in 16-color mode for now.

FAQ

Q: Don't TheDraw and some other programs already do ANSI animation?

A: Yes, but traditional ANSI animation does not provide any control over timing, instead relying on terminal baud rate to govern the playback speed. This does not work well on modern systems without baud rate emulation. Durdraw gives the artist fine control over frame rate, and delays per frame. Traditional ANSI animation also updates the animation one character at a time, while Durdraw updates the animation a full frame at a time. This makes it less vulnerable to visual corruption from things like errant terminal characters, resized windows, line noise, etc. Finally, unlike TheDraw, which requires MS-DOS, Durdraw runs in modern Unicode terminals.

Q: Can I run Durdraw in Windows?

A: Short answer: It's not supported, but it seems to work fine in the Windows Subsystem for Linux (WSL). Long answer: Some versions run fine in Windows Command Prompt, Windows Terminal, etc, without WSL, but it's not tested or supported. If you want to help make Durdraw work better in Windows, please help by testing, submitting bug reports and submitting patches.

Q: Can I run Durdraw on Amiga, MS-DOS, Classic MacOS, iOS, Android, etc?

A: Probably not easily. Durdraw requires Python 3 and Ncurses. If your platform can support these, it will probably run. However, the file format for Durdraw movies is a plain text JSON format. It should be possible to support this format in different operating systems and in different applications. See durformat.md for more details on the .dur file format.

Q: Does Durdraw support IBM-PC ANSI art?

A: Yes! IBM-PC ANSI art popular in the "ANSI Art Scene" uses Code Page 437 character encoding, which usually needs to be translated to work with modern terminals. When Durdraw encounters these files, it will convert them to Unicode and carry on. When you save ANSI files, it will ask if you want to use CP437 or Utf-8 encoding.

Q: I only see 8 colors in 16 color mode. Why?

A: Look in your terminal setting for "Use bright colors for bold," or a similarly named option. Durdraw's 16-color mode, like many vintage terminals (including MS-DOS), uses the Bold escape codes to tell the terminal the "bright" colors. This provides compatibility with many older systems. However, some terminals do not support or enable this option by default. Additionally, your terminal decides what colors to assign to the lower 16 colors.

Q: Some or all of the F1-F10 keys do not work for me! What can I do?

A: You can use ESC-1 through ESC-0 as a replacement for F1-F10. Some terminals will map this to Alt-1 through Alt-0. You can also use the following settings in some terminals to enable the F1-F10 keys:

  • GNOME Terminal: Click: Menu -> Edit -> Preferences -> General, and uncheck the box:

    • Enable the menu accelerator key (F10 by default)
  • Xfce4-Terminal: Click: Menu -> Edit -> Preferences -> Advanced, and check the 2 boxes:

    • Disable menu shortcut key (F10 by default)
    • Disable help window shortcut key (F1 by default)

LINKS, MEDIA AND THANKS

Special thanks to the following individuals and organizations for featuring Durdraw in their content:

Linux Magazine - https://www.linux-magazine.com/Issues/2024/281

Linux Voice Magazine - https://archive.org/details/LinuxVoice/Linux-Voice-Issue-015/page/n71/mode/2up

Bryan Lunduke at The Lunduke Journal - https://lunduke.locals.com/post/5327347/durdraw-like-thedraw-but-linux

Korben - https://korben.info/editeur-ansi-ascii-unicode-durdraw-creer-art-terminal.html

Jill Bryant and Venn Stone at Linux Game Cast - https://www.youtube.com/watch?v=HvZXkqg2vec&t=568s

LinuxLinks - https://www.linuxlinks.com/durdraw-ascii-unicode-ansi-art-editor/

Harald Markus Wirth (hmw) has made a Web .Dur Player in JavaScript: https://harald.ist.org/stubs/webdurplayer/

If you write, podcast, vlog, or create content about Durdraw, or if you simply enjoy using it, I'd love to hear from you! Please reach out to me via the GitHub project page or at [email protected].

SUPPORT

Your support means a lot to Durdraw! As a free and open-source project, your donations fuel my motivation to keep improving this software. Thank you for considering a contribution to help sustain and enhance this project.

Contributions help cover essential costs like development time, domain registration, and web hosting.

You can contribute to this project using any of these platforms:

Paypal - https://www.paypal.com/donate/?hosted_button_id=VTPZPFMDLY4X6

Buymeacoffee - https://buymeacoffee.com/samfoster

Patreon - https://patreon.com/SamFoster

Other ways to support Durdraw include reporting bugs, providing feedback, and contributing code. Please refer to the CONTRIBUTING.md file for information and guidelines.

If you need assistance or have questions about Durdraw, feel free to reach out to us on GitHub. We're happy to help!

COMMUNITY

There are community discussions on Github, where people post art made with Durdraw. Check it out: https://github.com/cmang/durdraw/discussions

We also have a Discord server for Durdraw users. Join us: https://discord.gg/9TrCsUrtZD

If you are feeling really old school, you can try the #durdraw IRC channel on irc.libera.chat.

CREDITS

Developer: Sam Foster [email protected]. For a full list of contributors, see the github page below.

Home page: http://durdraw.org

Development: https://github.com/cmang/durdraw

ANSI and ASCII artists: cmang, H7, LDA

LEGAL

Durdraw is Copyright (c) 2009-2024 Sam Foster [email protected]. All rights reserved.

The BSD Daemon is Copyright 1988 by Marshall Kirk McKusick.

This software is distributed under the BSD 3-Clause License. See LICENSE file for details.

durdraw's People

Contributors

alexmyczko avatar cmang avatar eyooooo avatar fcambus avatar sigurdo avatar yumpyy avatar zhenrong-wang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

durdraw's Issues

Allow to override width for loaded ASCII files

Just had the need to modify some ancient ASCII art for my consoles, and found Durdraw which seems to be the man for the job. But I've hit a serious problem: when you load a random ASCII file, the width is hardcoded to 80 columns, and it is not possible to override this via commandline options (-W / -m), which ends garbling any ASCII file wider than 80 columns (like the ones I'm trying to edit).

Right now, to achieve my goal I had to hack the sources (forcing default_width=120 as a test in loadFromFile at durdraw_ui_curses.py, and also uncommenting "width = max(width, maxWidth)" on durdraw_ansiparse.py seems to be the safest way to do this - everything else I tried ended with errors or enforcing 80 columns anyway), but the ideal solution would be to obey -W/-m when loading ASCII files.

hi again

sorry for the big QA push here xD

you accidentally introduced a bug for linux users. on install i get

FileNotFoundError: [Errno 2] No such file or directory: 'README.md'

just need to rename readme.md to README.md :)

thanks

Color weirdness when opening 256-color ANSI files

Certain 256-color ANSI files have incorrect colors when loaded in Durdraw. (not sure what they have in common; it just happens consistently with certain files but not with others). Sometimes, the image can be saved with the wonky colors but still has correct colors when viewed via cat, and sometimes, some (but not all) of the colors will be broken, and I will have to re-color parts of the image every time I make any edit. Sorry this isn't more specific or thorough; I don't have any frame of reference for what's happening here, and I can't reproduce it consistently. Hopefully this image explains itself better than I can.

colorist

Both images are the same file with no edits. The one on the left is viewed with cat, and the one on the right is in Durdraw. It's not in the screenshot, but if I save the right-hand image in Durdraw and then open the new version with cat, the cape will still be red, but the green meter/symbol in the upper right will be blue and white.

I'm using the dev branch, updated within the last day. Running Ubuntu 22.04 LTS.

I've attached the file in case it provides any insight.

gc42069.ans.zip

Feature request: "wait x"

Thanks for a great piece of software!

I think a switch for adding a delay before exiting when playing a file would be nice. My usecase is I use durdraw -p to play a file when I log into my machine, and by default that waits for key input before proceeding (which is suboptimal), and -x 1 causes the file to display but immediately disappear again. Adding something like --delay together with -p (which would wait either X seconds or until a key is pressed before continuing) would be pretty nice.

Crashes in MacOS 14.1.1 - curses has no attribute BUTTON5_PRESSED

Hi, love durdraw! This is fantastic. However, I am noticing an issue when I try running the example durdraw -p examples/*.dur.

After the initial doge ascii loads and the animation plays for a bit, if I press any keyboard button or mouse button or try to scroll the mouse, I get the following error:

Traceback (most recent call last):
File "/Users/<me>/Library/Python/3.9/bin/durdraw", line 8, in <module>
   sys.exit(main))
File "/Users/<me>/Library/Python/3.9/lib/python/site-packages/durdraw/main.py", line 220, in main
  ui.startPlaying()
File "/Users/<me>/Library/Python/3.9/lib/python/site-packages/durdraw/durdraw_ui_curses.py", line 944, in startPlaying
  elif mouseState & curses.BUTTON5_PRESSED:    # wheel down
AttributeError: module 'curses' has no attribute BUTTON5_PRESSED'

Thanks!

Unable to use any F1-F12 keys

Is there any option to remap these keys? They just don't work whatsoever. Or maybe there is an option to pick a character and use it as a draw character?

Im using Kitty 0.31.0-1 (xterm-kitty) on Arch Linux. None of the F1-F12 keys work and the draw/erase/color modes dont register click up or down, it instead just draws/erases/colors wherever the mouse is dragged regardless of whether the mouse is clicked or not. Really cool project btw!

Crashes in Windows 10: curses.panel.move() returns ERR

Durdraw 0.15 actually worked alright in Windows (in Command Prompt, Windows Terminal, etc) with windows-ncurses installed, but the latest build (0.17.2) has issues.

The issue seems to have started when I started using curses panels. Curses.panel.move() returns ERR. I haven't investigated too deeply, but some possible theories are that the Windows curses clone does not fully implement panels, or maybe that it needs a bit more care with the order things are done in. It would be nice if someone would help track down and fix the Windows issues.

Feature Request: terminal smaller than 80 columns when using -p argument

I like to "zoom in" on my terminal emulator to display/screenshot text art the largest possible setting. For still images, I can do this with the cat command, but .dur animations must be viewed in Durdraw, which cannot be viewed in a terminal narrower than Durdraw's interface. It would be neat if i could make the image larger when started in viewer mode, since the interface is never visible. Provided it's not more trouble than it's worth to implement, of course.

Thanks!

request: tutorial/manual

Hi

I would like to request tutorial/manual
I'm a beginner and have no idea how to use it. I use windows 10

License change?

I am considering changing Durdraw's licensing to a more widely used license, with the goal of simplifying any potential license considerations during redistribution (for distro packages, bundling, etc), or any other usage.

Currently Durdraw uses the ISC license. I am considering changing Durdraw to use one of the following licenses:

BSD, possibly the 3-clause License
MIT License - Everyone loves it. I know I do.

Any thoughts or considerations, from users or packagers, contributors, etc? Is this even an issue at all?

There is an interesting discussion on ISC vs MIT here.

Thanks!

AttributeError: module 'curses' has no attribute 'BUTTON5_PRESSED'

On macOS Sonoma, MacBook Pro, M1, in iTerm2 Build 3.4.23, clicking anywhere within the iTerm window results in the following exception:

Traceback (most recent call last):
File "durdraw/./start-durdraw", line 11, in <module> main.main()
File "durdraw/durdraw/main.py", line 242, in main ui.mainLoop()
File "durdraw/durdraw/durdraw_ui_curses.py", line 2032, in mainLoop
  elif mouseState & curses.BUTTON1_PRESSED or mouseState & curses.BUTTON4_PRESSED or mouseState & curses.BUTTON5_PRESSED:
AttributeError: module 'curses' has no attribute 'BUTTON5_PRESSED'

Other potentially useful details. I'm using the trackpad, doing nothing particularly fancy.

This project is really cool though! I hope to see the project continue to progress, and awesome work so far. Thanks for your contributions. ๐Ÿ™Œ

Canvas shrinked after converting to ANSI

I was working on a design concept on a 120 characters-wide canvas.

Screenshot from 2024-06-30 03-04-25

I decided to save the file in ANSI for better compatibility with other software.

I wasn't expecting it to overwrite the old file because of different extentions but it looks like they are the same type (binary).

When I open it that's what I see:

Screenshot from 2024-06-30 03-07-56

Opening with -W 120 doesn't help.

Background Colors in 256 color mode

Background colors only work in 16 color mode, and do not work in 256 color mode. This is because Python curses is unable to set color pairs past 256 pairs. This is enough pairs for all of the 16 FG and 16 BG color combinations, but not 256 FG and 256 BG color combinations.

Python has a method, curses.has_extended_color_support(), which is supposed to return True if more than 256 color pairs are supported. In this case, using Python 3.10, 3.11, and (I think) 3.12, the method returns True in macOS and the Linux systems I've tried. Even if the Python builds are compiled against Ncurses 5... which is a problem, because extended color pairs only work with the Ncurses 6 ABI.

So, when you try to set or use color pairs past 256, they do not work. No errors are returned. But they seem to wrap back around to write or read from color pair 1. For example, trying to read color pair 257 instead reads pair 1, pair 258 instead reads pair 2, etc. Writing pair 257 either overwrites pair 1, or seems to disappear into /dev/null. I think this is a bug in Python's extended color support.

I have seen this behavior in macOS and Linux systems. Python bug report #91132 seems to hint at the cause, which is that Python for macOS is compiled against Ncurses 5.9. This implies that it's using the Ncuress 5 ABI, which means that curses.has_extended_color_support() should be False, even though it isn't. (Python bug?)

I can think of 3 possible ways to fix this:

1: Only generate the color pairs that are needed, and hope the user never needs more than 256 pairs. This is not great, though, because Durdraw displays the entire 256 color palette on the screen at once. This means that all 256 color pairs are already in use. As an artist, I like seeing the entire palette at once and don't want to trade away that feature. So I am not crazy about this idea. (It might work nicely for RGB colors, though.)

2: Use a Python build that actually works with extended color pairs. I have not been able to get my hands on one yet, but this is the direction I have been leaning. We can wait for OS vendors and Python core developers to dsitribute Python binaries compiled correctly against the Ncurses 6 ABI, and fix the bugs with extended color pair reporting. This would be nice, but we don't seem to be there yet.

3: Steer away from using Ncurses all together for generating color escape codes. They might be able to be injected with puts() or something, but this breaks ncurses convention and may break across different ncurses versions. Or, ncurses might be replaced with another library completely. This would be a lot of work with refactoring and rewriting Durdraw code. It might also break some portability. I don't like this option, either. :)

Crash opening durdraw file created from 0.11

burt.zip

when i run durdraw burt (the file attached above), durdraw crashes with the following traceback:

Traceback (most recent call last):
  File "/usr/bin/durdraw", line 33, in <module>
    sys.exit(load_entry_point('durdraw==0.21.1', 'console_scripts', 'durdraw')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/durdraw/main.py", line 220, in main
    ui.refresh()
  File "/usr/lib/python3.11/site-packages/durdraw/durdraw_ui_curses.py", line 2822, in refresh
    self.addstr(linenum, colnum, str(line[colnum]), curses.color_pair(cursesColorPair))
  File "/usr/lib/python3.11/site-packages/durdraw/durdraw_ui_curses.py", line 359, in addstr
    self.stdscr.addstr(y, x, str, attr)
ValueError: embedded null character
durdraw --version
0.21.1

durdraw 0.11 opens it okay.

durformat spec reverses x/y

I'm trying to write a converter from .dur to .ddw (DarkDraw), and it looks like the specification for colorMap has the x/y coordinates reversed from the actual format.

From durformat.md:

Each element of the colorMap should coordinate with a corresponding line and column in the contents. For example, colorMap[2][3] should describe the foreground and background color for the character at contents[2][3], which is the character at Line 2, Column 3 of the given frame.

This makes sense to me and is what I expected, but looking at e.g. indyz-linuxfire.dur, there are 80 elements in colorMap, which corresponds to the width instead of the height.

16-color picker (alt+c) does not function below a certain terminal size

Using alt+c to select colors in 16-color mode only seems to work if the canvas height is smaller than the terminal viewing area, and the 8x2 palette is visible on the lower right. Not sure if this is intentional or not.

I'm on Ubuntu, using the dev branch.

First issue I've submitted on github; apologies if there is some kind of protocol I should be following.

There was an error setting the color./selt' is not defined in durdraw_ui_curses.py

Just happened upon this. Pretty sure it's just a typo, and no idea how significant it is, but I thought you might want to know about it. Durdraw crashed (I think while I was changing colors. Not 100%; it was abrupt.) and printed an error message to the console notifying me that 'selt' is not defined in durdraw_ui_curses.py. :

selt.nofiy("There was an error setting the color. Please file a bug report explaining how you got to this error.")

docker run

Using the tool with docker run to avoid installing python locally would be welcome.

Could be also OS independent in that way.

Convenient for terminal environment.

Crushes when I try to change character set

That's what I see when I try to select "Box-drawing characters":

Screenshot from 2024-06-29 05-33-41

When I try to type:

Screenshot from 2024-06-29 05-35-25

Screenshot from 2024-06-29 05-35-43

Had to kill the process by closing the terminal tab.

That's what I see in command history after:

Most recent:

user@fedora:~/Documents$ 64;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M64;58;39M64;58;39M64;58;39M64;58;39M64;58;39M64;58;39M64;59;22M64;59;22M64;59;22M64;59;22M64;59;22M64;59;22M64;75;13M64;75;13M64;75;13M64;75;13M64;75;13M65;75;13M65;75;13M65;75;13M65;75;13M65;75;13M65;75;13M64;75;13M64;75;13M64;75;13M64;75;13M64;75;13M64;75;13M65;75;13M65;75;13M65;75;13M65;75;13M65;75;13M65;75;13M65;75;13M0;58;40M0;32;30m0;54;40M0;49;25m0;57;40M0;34;28m0;57;40M0;57;40m0;57;40M0;57;40m0;54;40M0;54;40m0;54;40M0;54;40m64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;109;28M64;109;28M64;109;28M64;109;28M64;109;28M64;109;28M64;109;28M64;109;28M0;88;19M0;88;19m0;30;19Ms0;30;19mtrtr

Second most recent:

user@fedora:~/Documents$ 64;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M65;114;33M64;58;39M64;58;39M64;58;39M64;58;39M64;58;39M64;58;39M64;59;22M64;59;22M64;59;22M64;59;22M64;59;22M64;59;22M64;75;13M64;75;13M64;75;13M64;75;13M64;75;13M65;75;13M65;75;13M65;75;13M65;75;13M65;75;13M65;75;13M64;75;13M64;75;13M64;75;13M64;75;13M64;75;13M64;75;13M65;75;13M65;75;13M65;75;13M65;75;13M65;75;13M65;75;13M65;75;13M0;58;40M0;32;30m0;54;40M0;49;25m0;57;40M0;34;28m0;57;40M0;57;40m0;57;40M0;57;40m0;54;40M0;54;40m0;54;40M0;54;40m64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;76;16M64;109;28M64;109;28M64;109;28M64;109;28M64;109;28M64;109;28M64;109;28M64;109;28M0;88;19M0;88;19m

Third is my real command.

Esc-[ can't change character sets in Playback mode

I discovered recently that edits made while an animation is playing are applied to all frames in the playback range, which is super convenient! (Though, I do not believe this is mentioned anywhere in the documentation.)

Adding and removing columns works this way, as does removing lines, but I cannot seem to add a line while an animation is playing, neither with esc+/ nor with alt+/.

I can achieve the desired outcome by cutting/pasting across all frames in range when the affected area is the same in all frames, but this can be a bear if I need to shift an entire animation downward or create more space at the top of the image.

Thanks!

Draw/Color/Erase: Mouse button can get stuck held down

There is an annoying bug with the mouse button getting stuck.

To reproduce:
1: Go into a mode where you can click and hold down to do something, like Draw, Erase or Color.
2: Click down on the mouse somewhere in the canvas, and drag the mouse cursor outside of your terminal window.
3: Let go of the mouse button while the cursor is outside of the terminal.
4: Move the mouse cursor back into the terminal window.

Durdraw will still think the mouse button is held down. You can reset this with a single click or double click, usually, and avoid the issue completely by avoiding dragging the cursor outside of the window with the mouse button held down.

This has to do with the (probably dumb) way that Durdraw interacts with Ncurses' mouse functions in /durdraw/durdraw_ui_curses.py, and stores the mouse state.

Here is a link to the appropriate section in a commit, in the monster mainLoop() method:
https://github.com/cmang/durdraw/blob/32e601901477cf6ba25accb7cb09b3dffa5348ba/durdraw/durdraw_ui_curses.py#L1917C37-L1917C37

Any help would be appreciated!

first run issue

following default install instructions - cloning repo and installing via pip or setup.py, durdraw doesnt start. no issues on install, both methods report install good.

username@My-MacBook-Pro durdraw % durdraw
Traceback (most recent call last):
  File "/opt/homebrew/bin/durdraw", line 33, in <module>
    sys.exit(load_entry_point('durdraw==0.17.2', 'console_scripts', 'durdraw')())
  File "/opt/homebrew/lib/python3.10/site-packages/durdraw-0.17.2-py3.10.egg/durdraw/main.py", line 72, in main
    app = AppState()    # to store run-time preferences from CLI, environment stuff, etc.
  File "/opt/homebrew/lib/python3.10/site-packages/durdraw-0.17.2-py3.10.egg/durdraw/durdraw_appstate.py", line 31, in __init__
    if curses.has_extended_color_support(): # Requires Ncures 6
NameError: name 'curses' is not defined

macos, python 3.10.9, pip 22.3.1

i confirmed curses does exist. is it because durdraw_appstate.py does not import curses? my python kind of sucks - sorry.

macos terminal.app issues with extended ansi

ive been struggling to get the extended ansi chars to work on a 2021 mbp terminal.app. ive tweaked all the dials and buttons in the profile but no luck yet. hoping someone else maybe has a tip?

thanks

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.