Git Product home page Git Product logo

focus's People

Contributors

aang521 avatar amasondev avatar arjenwitteveen avatar audv avatar cellth avatar cookednick avatar focus-editor avatar hfr4 avatar ileonte avatar jakwolf avatar jejikeh avatar jlami avatar jmpstar avatar lainlayer avatar leonaders avatar maxamundsen avatar mulej avatar nick-celestin-zizic avatar obiwanus avatar olyaivanovs avatar onelivesleft avatar pixelrifts avatar polgartom avatar rluba avatar roman-skabin avatar sanian-creations avatar sentientcoffee avatar simonvallz avatar valignatev avatar wwilliams741 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

focus's Issues

Misalignment for auto-indent when in function body

set tab_size to something != 4

int main() {
  int arg; // <-- press enter here
}
...
int main() {
  int arg;
  // <-- spaces are created here instead of tabs leading to misalignment if tab_size is set to something < 4
}

Massive memory leak

Describe the bug
When loading a project with access to two folder of roughly 40 GB of size total (not only text data), the memory consumption increases with seemingly no end.

To Reproduce
Load a large project? Small projects seem to work just fine.

Expected behavior
Only allocate the necessary RAM that is needed.

Screenshots

The project is loaded at the beginning of the memory graph and the editor starts using more and more ram
image

It keeps filling the memory, see the "Committed" amount
image

  • OS: [e.g. Windows]
  • Win 11
  • Focus Version: 0.1.10, 0.1.9

Additional context
The two folders loaded in the project are of sizes 35.2 GB and 9.5 GB, so even if all the data is loaded, it should not be much larger than 50 GB I believe.

Feature Request: Compilation

It's one thing that I love in vim, emacs, 4coder, and to some extent VSCode :

  • Run a project specific command inside the editor
  • It grabs output and prints it to a buffer
  • Creates links to the reported error locations

I'd be happy to try working on this but I might take a lot of time as I'm not super familiar with the codebase yet.
Let me know if you think this is a good idea and if my suggested flow fits within your vision.

Feature request: word completion

A feature I really can't live without from emacs/vim is a basic way to complete text. The way it works is you type something like "get_" and then you press tab (or whatever keybinding) to cycle between different options like "get_entity", "get_string", "get_thing", etc. I think this feature fits in with focus's style since it's very basic and easy to understand and it's not annoying and in-your-way as IDE-style dropdown word completions.

Emacs also prioritizes completions from the current file that are nearest to the cursor and then searches for completions in the most recently opened files, which I find works extremely well.

This is what it looks like. After it cycles through all the completions it returns back to the original text that was typed in.
4ed_1veXRW79TC

You could have settings that sets a max count of all the completions focus can find and you could also have a setting if you prefer the word completion to be case sensitive or not (or maybe make two separate commands for each one).

Potential race condition when opening a new empty buffer?

Describe the bug
It feels like there is a race condition when opening new empty buffers. When using Ctrl+N I will sometimes get a new empty buffer (expected), sometimes get a buffer with a random file from within my workspace directories (unexpected), and other times will get a crash (unexpected).

To Reproduce
Steps to reproduce the behavior:

  1. Open the editor .\focus.exe
  2. Open a new empty buffer Ctrl+N
  3. If you get a valid empty buffer, type a few characters into the buffer and repeat from step 2 until you see the strange behavior

Expected behavior
A new empty buffer is created every time

Screenshots
N/A

  • OS: Windows
  • Focus Version: Latest commit (hash: 5e8ecee)

Additional context
Here is the stack trace from when it crashes:

Array bounds check failed. (The attempted index is 0, but the array has dimension 0, so no index is valid). Site is L:/Dev/Third-Party/focus/src/buffer.jai:109.
Panic.
A breakpoint was hit, but no debugger is attached.

Printing the stack trace:
handle_exception                  F:\tools\Jai\jai-beta-1-062\modules\Runtime_Support_Crash_Handler.jai:363
... (skipping OS-internal procedures)
debug_break                       L:\Dev\Third-Party\focus\modules\Runtime_Support.jai:12
my_panic                          L:\Dev\Third-Party\focus\modules\Runtime_Support.jai:143
__array_bounds_check_fail         L:\Dev\Third-Party\focus\modules\Runtime_Support.jai:196
offset_to_coords                  L:\Dev\Third-Party\focus\src\buffer.jai:109
get_cursor_coords                 L:\Dev\Third-Party\focus\src\buffer.jai:125
draw_editor                       L:\Dev\Third-Party\focus\src\draw.jai:368
draw_frame                        L:\Dev\Third-Party\focus\src\draw.jai:21
main                              L:\Dev\Third-Party\focus\src\main.jai:228

The crash seems to be from the editor attempting to draw the buffer before the initialization code can add the first line to line_starts? But what is stranger to me, is when the buffer opens but is loaded with the content of a random file in my workspace directories.

The editor does not set up the own environment and so on.

When I run the editor on Ubuntu 22.04.2 I see in a folder only focus-linux, there is no a project folder or another the editor's folders also
can not close the editor because I don't have a window title and I have by default the cross cursor.

Plans for plugin support?

Most likely answer is "no, just fork and modify source", but if I think of other editors like helix or neovim, it would be handy to have some kind of LSP support to help catch compilation issues (this can be an opt-in type of experience). I don't need an IDE-like experience. I find that go to symbol / find usages, split view, and easy file system traversal are about all I need to stay sane while working in a codebase, but I'm doing embedded work right now and the cross compilation toolchain takes forever - so being able to see comp errors as I'm developing would also be helpful.

feature: tabs

Not a bug, but a feature suggestion

I would like to see tabs added

Why? it's part of my workflow, i like setting context trough tabs when i'm working on something instead of constantly switching buffers and typing file names, it's a waste of time

Editor cannot find fonts under linux

From this error message:
Screenshot_20230504_183728
The editor only looked in /usr/share/fonts, but this is what my /usr/share/fonts directory looks like:

Screenshot_20230504_185715

The font I wanted was located in /usr/share/fonts/TTF.

Linux support

could you add a Linux version with the release binaries?

keymap combinations assume QWERTY (macOS)

  • OS: macOS 12
  • Focus Version: 0.1.6

Describe the bug
On macOS the keymap combinations assume US QWERTY is the keyboard layout.

Example 1
To Reproduce with AZERTY layout
Steps to reproduce the behavior:

  1. Go to 'System Preferences -> Keyboard -> Input Sources'
  2. Click on '+'
  3. In the search field type 'French'
  4. Click ABC - AZERTY
  5. Click Add
  6. Click ABC - AZERTY
  7. Open Focus
  8. Press Command-N (note the 'N' key is in the same place on both the AZERTY and QWERTY layouts)
  9. Type "testing"
  10. Press Command-Z (note the 'Z' key on the AZERTY layout is in the location of the 'W' key on the QWERTY layout, and vice-versa)

Expected behavior
The typing of the word 'testing' to be undone.

Actuall behaviour
The file is closed

Example 2
To Reproduce with Dvorak layout
Steps to reproduce the behavior:

  1. With a US keyboard layout
  2. Open Focus
  3. Press Command-Shift-P
  4. Type 'Open Global Config'
  5. Press 'Return'
  6. Move the cursor to the beginning of the 'allow file extensions' list (which begins with ".jai .c .cpp"
  7. Type ".plist "
  8. Go to 'System Preferences -> Keyboard -> Input Sources'
  9. Click on '+'
  10. In the search field type 'dvorak'
  11. Click Dvorak
  12. Click Add
  13. Click Dvorak
  14. Go back to Focus
  15. Press Command-Z (note the 'Z' key on the Dvorak layout is in the location of the '/' key looking at a QWERTY layout)

Expected behavior
The typing of the word ".plist " to be undone.

Actuall behaviour
The 'Toggle Code Comment' command is issued, adding a "# " to the beginning of the line.

Feature Request: Other file

Describe the bug
A command associate other file that allows the user to locate a file that should be paired with the current file.
For example: .h files for the currently open .c file.

If no other file has been associated with the current file launch the open file dialog and mark whatever file is opened as corresponding to the current file.

Subsequent other file commands will simply switch between the two files.

A command to clear the association would make the feature complete.

A more general utility would be to provide a pattern matching association in config, reverting to the specific file association if the match can not be found.

Launching from the command line with a path segfaults.

❯ ./focus /home/martijn/w/ClassroomPerf/server.cpp
Segmentation fault. The faulty address is 0x0, from 0xa09a8d.
./focus(platform_set_window_title_200000319+0x7d) [0xa09a8d]
./focus(update_window_title_a000001f0+0x4be) [0x9f428e]
./focus(editors_open_buffer_a000001bf+0x629) [0xa0e0f9]
./focus(editors_open_file_a000001bd+0x634) [0x9df7a4]
./focus(__program_main+0x15c7) [0xae3277]
./focus(__system_entry_point_800000125+0x45) [0xb14f25]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f1bba0b0083]
./focus(_start+0x2e) [0xb175de]

Editor is stuck when a file dialog opens (Windows)

On Windows, the OS open file dialog that opens when saving a new file causes the editor to not update until the dialog is closed. This leads to confusing situations where it seems the editor is stuck but really it's just that the dialog is still opened behind the editor window. Particularly, resizing the editor window while the dialog is opened breaks the rendering for example.

Expected behavior
Ideally the editor should still update normally, without allowing the user to interact with it (window resizes for example should still be reacted to)

  • OS: Windows
  • Focus Version: 0.1.7

Linux: Symbolic Links Not Visible in File Explorer

Add a directory as a workspace in global config, then ensure that the directory has a symbolic link to some file. In my case, it is a directory that has within it a rootfs folder, and the symlinks are common files within the rootfs that I store at the TLD so I don't have to click/cd around to find them every time.

The symbolic links are not visible when the open dialog opens.

Linux stuttering while scrolling with high key repeat.

I suspect this is not a linux issue but I could be wrong. I have a faster key repeat setting than normal, something you should be able to set up on linux and windows. The issue is that when the cursor goes off the end of the window the frame rate drops significantly. I suspect this has something to do with how you are handling events.

Editor looks awesome though! I don't have jai access but I was able to run the executable just fine.

Wrong active panel switching with history

Describe the bug
When closing the right panel using "close_other_editor" shortcut then moving to previous history, the active panel switch side

To Reproduce
Steps to reproduce the behavior:

  1. Open a file
  2. Dupicate to the right using "duplicate_editor" shortcut
  3. Make the left editor active
  4. Close right editor using "close_other_editor" shortcut
  5. Go to previous history using "move_to_previous_editor_history" shortcut
    => The active panel is now the right one

Expected behavior
Since we closed the right panel with the left panel active in step 4. , the left panel should still be the one active in step 5.

Screenshots
1

Version
0.1.10

Focus editor crashes on files larger than 2GB

I'm using focus 0.1.10 on windows 10.

I tried to open 2GB csv file.
test2310722_.csv (exact size is 2 152 105 405 bytes)
focus editor crashed with error:
Array bounds check failed in file W:/focus/src/buffer.jai at line number 111: Provided index: -2147483335, maximum index: 2147483961

When I tried to open slightly smaller file
test2310720.csv (exact size os 2 152 103 659 bytes)
Everything worked fine.

focus editor on windows 10 does not open files with the unicode symbols in the file name.

focus editor on windows 10 does not open files with the unicode symbols in the file name.

Example:

.\focus.exe .\test.txt
Everything works fine.

.\focus.exe .\test©.txt
Focus editor opens, but shows the main page instead of opening a file.

Same goes for files with greek or cyrillic symbols in the filename:
.\focus.exe .\testα.txt
Focus editor opens, but shows the main page instead of opening a file.

.\focus.exe .\test_кириллица.txt
Focus editor opens, but shows the main page instead of opening a file.

BTW, if you open focus editor manually and drag-and-drop files into it, it opens all files (symbols in the filenames doesn't matter).

Assertion failed when switching projects

Describe the bug
When I open the editor in windows (I have not tried other OSes), via command line .\focus_debug.exe and then immediately hit Ctrl+Shift+P and select Switch To Project then picking any project I have in the given list, the program will hang for a few seconds, and then crash with the following assertion:

F:/tools/Jai/jai-beta-1-062/modules/Thread/thread_group.jai:251,5: Assertion failed!
Stack trace:
F:/tools/Jai/jai-beta-1-062/modules/Preload.jai:380: default_assertion_failed
F:/tools/Jai/jai-beta-1-062/modules/Basic/module.jai:83: assert
F:/tools/Jai/jai-beta-1-062/modules/Thread/thread_group.jai:251: shutdown
L:/Dev/Third-Party/focus/src/widgets/finder.jai:16: deinit_finder
L:/Dev/Third-Party/focus/src/workspace.jai:145: hard_reload_workspace
L:/Dev/Third-Party/focus/src/main.jai:236: main
A breakpoint was hit, but no debugger is attached.

To Reproduce
Please see the description

Expected behavior
The program should successfully load the project and display the green notification in the bottom right

Screenshots
N/A

  • OS: Windows
  • Focus Version: Build from source with latest commit [commit hash: 1227d37]

Additional context
It seems from my searching that the finder is being shutdown before it's initialized? Replacing focus/src/widgets/finder.jai:16 with if finder.initted shutdown(*thread_group); seems to fix the issue. But I'm unsure if the finder is expected to be initialized prior to this? If so the problem probably lies elsewhere.

I have the fix in a fork if a PR is needed, but I feel this is such a small change its probably not worth the fuss? Let me know :)

Numpad keys in shortcuts

Can you please add the ability to map numpad keys? I just used to some shortcuts like ctrl+numpad4 and ctrl+numpad6 to switch between left and right editor 🙂


----------------
Version: 0.1.4

tokenizers mark r_brace as l_brace

Describe the bug
In c.jai, csharp.jai, jai.jai, the tokenizer marks #char "}" as .l_brace

To Reproduce
Steps to reproduce the behavior:

  1. Open above files and search for .l_brace

Expected behavior
Should be .r_brace!

Font horizontal spacing issues

I'm trying out the linux build. It ran out of the box, so props for that! Most stuff is working as expected.
However, fonts are rendered significally different from what I would expect. For example here are screenshots of Roboto Mono Regular size 17 of the same line from Sublime (top) and Focus (bottom). The individual glyphs are the same, but the spacing is way too narrow.
focus_ref2
focus_ref

macOS Release

I'd like to use this on macOS. Can you add a macOS binary or bundle to the releases? Alternately I'd love to get into the jai beta, build focus myself, and help support this project.

Default Keys Ignore Custom Key Configuration

Describe the bug
Some of the default key shortcuts are hardcoded and even though I delete every instance of them from the global config file, application still insists on using its own default keys.

To Reproduce
Steps to reproduce the behavior:

  1. Open Global Config
  2. Replace [[keymap]] section with:
[[keymap]]

[editors]

[open file dialog]

[search dialog]

[common]
  1. Save the config
  2. Try using default key shortcuts like Ctrl-O or Ctrl-P etc.

Expected behavior
Since the config file gives the user a config file where you can customize the key shortcuts, a removed shortcut should be removed!
This feels like an important issue since one can wish not to have an action bind to "Ctrl-O" for example.

  • OS: Windows
  • Focus Version: 0.1.6

Umlauts in the file name

I have connected the editor to open for example json files. But if a file is called 'für.json' (with umlauts) the editor starts without opening the file. Drag'n'drop the file into the editor, still works.

Feature Request: Include "Open config" option in the drop-down menu that appears when clicking the app icon on the top left of the editor

On Windows certain apps have useful options when clicking the app icon on the top left of the window (shown below).
Can Focus have an option there that shows "Open global config" or something similar that opens the global config in the editor? This can be extended to also have options that open project specific configs.
I know it there is a shortcut for this, but it would be a nice accessibility feature for those that make minimal use of shortcuts.

On command prompt, for example there is a clicking "Properties" option that opens a properties dialog.
image

Similar options are found in the Windows PowerShell and Git Bash terminals. I believe Cmder has it as well.

Currently, the Focus editor has this:
image

(Just to clarify, I'm not asking for a whole menu that lets you configure the same settings you wound in the conifg, just a menu option that maps to the command "Open global config".)

Font hinting options?

Font rendering on Windows sometimes look really bad depending on the size/scale/font. I tried messing with OGL FT code but couldn't achieve desirable results. What I wanted to do is force grayscale hinting, since this hRGB hinting is really strong and noticable on my 4K screen.

Also many fonts look weird in terms of glyph rendering, spacing can be off on certain sizes, on others it's okay. For example using Cascadia Mono you can see weird horizontal glitch in glyph t in the middle of the vertical line.
Screenshot 2023-05-08 141135

I assume this comes down to Simp library and FreeType version that it is using so it won't be easy thing to solve I assume.

Crash after history manipulation

Describe the bug
Crash after history manipulation

To Reproduce

  1. Open a buffer
  2. Duplicate it to the right using "duplicate_editor" shortcut
  3. Close the left one using "close_other_editor" shortcut
  4. Move back history using "move_to_previous_editor_history" shortcut
    => the left panel doesn't reopen
  5. Move back history another time
  6. Move cursor anywhere on the editor
  7. Move back history
  8. Move cursor anywhere on the editor
    => Crash

Expected behavior
Should open the left buffer on step 4 and not crash :)

Screenshots
1

Version
0.1.10

Viewport Scroll Stuttering

Describe the bug
Scrolling starts stuttering after a second when using scroll_viewport key commands. Holding Shift a moment after pressing the key-combo prevents the stuttering completely.

To Reproduce
Open big enough file and hold Alt-J/K or E/D. You should notice stuttering a second into the scroll. Hold Shift a moment after starting the scroll and it should disappear.

Expected behavior
Scrolling should be smooth.

  • OS: Windows
  • Focus Version: 0.1.9

Additional context
I think whatever input code controls scrolling is using "raw" text input from the keyboard. Like holding a key in a text box, it fires off an input event once, pauses, then fires them in rapid succession. Assuming that's the case, switching to Key-State based input would be the proper fix. Just a hunch though!

Keyboard layout seems to not be respected.

I tried it out for the first time, and it seems that I cannot control Focus if I'm on AZERTY keyboard layout. Also, after changing to QWERTY, I was following the default config file, and tried Ctrl-Shift-, to duplicate the editor, but that didn't work. Only Ctrl-, worked.

High CPU use when editor is used for some time

Minimize editor, do something else for some time (in my case use Unity editor), go back to Focus editor and it has very high CPU use that is unusable.

It happened twice in such circumstances but it's hard for me to reproduce it freely, so it might not be related to minimizing application but some other OS behaviour?

EDIT: looks like I can reproduce it by just using editor for some time and it might be related with C# files support.

  • Editing C# files

  • OS: Windows 10
    focus

Unable to save file

Unable to save file created with ctrl-n by pressing ctrl-s or the save dialog when quitting focus.

Focus only outputs "name = 'filename" to console when pressing ctrl-s and no errors,
the "save" button in the quit focus dialog does nothing only "cancel" and "don't save" do anything.
I also didn't find a way to determine which folder it tries to write to.

I tried default config file and running focus as sudo.

Linux Mint 21.1 Cinnamon with 5.19.0-43-generic Kernel.
focus-linux Version 0.1.10.

b

Crash when logging in a thread

Notice: I sent an email already about this to Jon, since it's a fix to be done in the Thread module, but I'm still making an issue to keep track of the bug and provide a quick fix.

The editor crashes when logging in a separate thread, when the logger is session_logger (really it crashes when a logger is set that does not expect context.logger_data to be null).

The fix for this would be to set each thread's starting_context.logger_data to context.logger_data, specifically:

In workspace.jai, line 43:

// @Temporary: fix for logger starting context logger data not being set correctly in thread_init
for * file_list_thread_group.worker_info
    it.thread.starting_context.logger_data = context.logger_data;

line 75:

// @Temporary: fix for logger starting context logger data not being set correctly in thread_init
for * scanner_thread_group.worker_info
    it.thread.starting_context.logger_data = context.logger_data;

Version 0.1.8 shows 0.1.7 on startup screen for Linux

Describe the bug
A clear and concise description of what the bug is.

I downloaded version 0.1.8 for Linux and upon opening the binary was showing that it was version 0.1.7. I double checked and yes I am downloading the correct file. A quick glance at source shows that version 0.1.8 is defined in first.jai or something like that, so I don't know where this stale reference is coming from. Is this a field in some config file somewhere? Most likely user error, but I thought I would report it anyway.

UI elements hovered through an overlapping window

Describe the bug
UI elements react to the mouse position (they are visually hovered), even when the window is hidden.
This happens on Windows (haven't tested any other platform), this might be different on other OSes since it's a window thing.

To Reproduce
Just put a window in front of the editor window and hover the mouse over UI elements like a scrollbar or the pane separator.

Expected behavior
UI elements should not react to the mouse when the editor window is hidden behind another window.

Comping with -x64 and - release cause scroll not to work.

I am experimenting a little, and compiling like this:

~/focus
❯ ~/Downloads/jai/bin/jai-linux -x64 first.jai - release

Works fine, but when opening a file, I can't scroll. That's a very strange bug to report -- I know, but it seems to be consistent.

Also, pressing j on the keyboard, seems to replace the whole file by a bunch of i:

image

I hope you can reproduce this.


❯ ~/Downloads/jai/bin/jai-linux -version
Version: beta 0.1.061, built on 16 April 2023.

Animation problems with history

Describe the bug

  1. When undoing the history, if a file was opened on the left the reopening animation is in the wrong direction
  2. There also isn't any animation when the moving back in the history close a panel.

To Reproduce

  1. Open a file
  2. Open another file on the left
  3. Close the left file
  4. Undo history

Screenshots
2

Focus Version
0.1.10

Typing path with direct match

When typing '/' in the file opener the top result in the list is selected. The bug is that there can be an exact match in the list but this directory is not opened. Basically, typing a slash should not autocomplete when there is an exact match.

Segoe UI licencing?

IANAL, but I don't think you can just bundle the Segoe UI font like that. See here for more info: https://learn.microsoft.com/en-us/typography/fonts/font-faq

In particular:

How about Segoe UI? I love it and would like to include that in my non-Windows app or game. Is it available from Monotype?

No, as Segoe UI is both our user interface and corporate branding font, it is not available for use outside of Microsoft products on non-Windows platforms. However, we do have a Segoe-compatible open-source font you can use:  Selawik.

In Open-File navigation, pressing "/" when one of the folders is literally called "/" (root on Mac/Linux) should probably open root rather than the selected folder

I don't know. I'm definitely open to debate on this. I just have a sense that this feels wrong.

I often partially-type folder names then push Enter rather than use the arrow keys (then Enter) to select folders. "/" makes perfect sense as an alternative to Enter.

It is just this one particular case, when the box is blank, on Mac/Linux, the final root folder is always "/". So I find it "inconsistent" when I type "/" and it just selects the first folder, when "/" is a perfect name-match for the last folder in the list.

This could be an exception to the otherwise perfect rule. On Mac/Linux, we could simply select the "/" folder if it is present when that key is pressed. It is also consistent that this is the only time you will ever have this situation occur, so adding a special rule for this one case should not have odd side effects in theory.

Before pushing "/"

Focus andd VS

Weird one: run Visual Studio (2022 here) and then run Focus, within ~10 seconds Focus.exe exits/crashes. Do that in the reverse order (Focus first, the VS)... no problem.

Paths are compared incorrectly on windows

Describe the bug
When paths are compared (for example, to see if the config file has been updated) it is done with a simple == comparison. However, on windows filenames are not case sensitive so this is broken.

To Reproduce
Steps to reproduce the behavior:
Make a project and set its workspace folder to a different cased version of the path.

My fix for it is in this commit (it's pretty simple)
onelivesleft@95a1576

Copying from focus causes Chrome to crash

Describe the bug
Copying a section of the provided program.c file causes crashes in Chrome and Focus, and not working in any other program.

To Reproduce
Steps to reproduce the behavior:

  1. Download program.zip and extract program.c
  2. Press Alt+x, then Navigate To File From Root until you reach the file.
  3. Copy from the following section (yes I am aware I did not intialize curses):
#include <stdio.h>
#include <unistd.h>
#include <curses.h>

int main() {
    cbreak();
    echo();
    int value;
    scanf("%d", &value);
    return 0;
}
  1. Paste in any other program
  2. Program stops responding/doesn't read input, upon pasting in focus, focus stops responding.

Expected behavior
Copied text is handled correctly and does not cause crashes.

Screenshots
My pc is not in English so any screenshots might be confusing. Anyways, I don't think any visual aid is needed. I can provide if you want, though.

  • OS: Fedora 38
  • Wayland
  • Focus Version: 0.1.9

Additional context
I have set the environment variable FOCUS_LD_BACKEND to Wayland

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.