---
name: "wins_wstr"
section: "3x"
platform: "linux"
package: "ncurses"
version: "6.6-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/curs_ins_wstr/3x"
---

# wins\_wstr(3x)

insert a wide-character string in a curses window

Part of [curs\_ins\_wstr(3x)](/curs_ins_wstr/3x.md).

## NAME

**ins\_wstr**, **wins\_wstr**, **mvins\_wstr**, **mvwins\_wstr**, **ins\_nwstr**, **wins\_nwstr**, **mvins\_nwstr**, **mvwins\_nwstr** - insert a wide-character string in a *curses* window

## SYNOPSIS

```
#include <curses.h>
```

**int ins\_wstr(const wchar\_t \*** *wstr***);** **int wins\_wstr(WINDOW \*** *win***, const wchar\_t \*** *wstr***);** **int mvins\_wstr(int** *y***, int** *x***, const wchar\_t \*** *wstr***);** **int mvwins\_wstr(WINDOW \*** *win***, int** *y***, int** *x***,**\
       **const wchar\_t \*** *wstr***);**

**int ins\_nwstr(const wchar\_t \*** *wstr***, int** *n***);** **int wins\_nwstr(WINDOW \*** *win***, const wchar\_t \*** *wstr***, int** *n***);** **int mvins\_nwstr(int** *y***, int** *x***, const wchar\_t \*** *wstr***, int** *n***);** **int mvwins\_nwstr(WINDOW \*** *win***, int** *y***, int** *x***,**\
       **const wchar\_t \*** *wstr***, int** *n***);**

## DESCRIPTION

**wins\_wstr** **inserts a wide-character string** *wstr* **before the character at the cursor in window** *win* **as if by calling wins\_wch(3X) for each** *wchar\_t* **in** *wstr*. **No line wrapping is performed.** **Characters to the right of the cursor are shifted right;** **those at the right edge of the window may be lost.** **wins\_wstr** **stops inserting if it would have to wrap to the next line to write the** **next** *wchar\_t* **in** *wstr*. **The cursor position does not change** **(after moving to** (*y*, *x*), **if specified).** **wins\_nwstr** **does the same,** **but inserts at most** *n* **wide characters,** **or as many as possible** **(up to the end of the line)** **if** *n* **is negative.** **ncurses(3X) describes the variants of these functions.**

## RETURN VALUE

**These functions return** **OK** **on success and** **ERR** **on failure.**

**In** *ncurses*, **they return** **ERR** **if**

- •

  *win* **is** *NULL*,

- •

  *wstr* **is** *NULL*,

- •

  **the first wide character in** *wstr* **is a non-spacing character,** **or**

- •

  **an internal wins\_wch(3X) call returns** **ERR**.

**Functions prefixed with “mv” first perform cursor movement and** **fail if the position** (*y*, *x*) **is outside the window boundaries.**

## NOTES

**All of these functions except** **wins\_nwstr** **may be implemented as macros.**

## EXTENSIONS

**ins\_nwstr**, **wins\_nwstr**, **mvins\_nwstr**, **and** **mvwins\_nwstr**'s **acceptance of negative** *n* **values is an** *ncurses* **extension.**

## PORTABILITY

**Applications employing** *ncurses* **extensions should condition their use on the visibility of the** **NCURSES\_VERSION** **preprocessor macro.**

**X/Open Curses Issue 4 describes these functions.** **It specifies no error conditions for them.**

**X/Open Curses does not specify what happens** **if a non-spacing character follows a control character.**

**Issue 4 states that the entire string is inserted if** *n* **is less than 1.** **This is probably an error,** **because it is inconsistent with other functions** **such as** *waddwstr*, **and differs from the SVr4** *curses* **and Solaris** *xcurses* **implementations.** **Nevertheless,** **Issue 7 retains the language.**

## HISTORY

**X/Open Curses Issue 4 (1995) initially specified these functions.** **The System V Interface Definition Version 4 (1995),** **specified functions named** *winswstr* **and** *winsnwstr* **(and the usual variants).** **These were later additions to** SVr4.*x*, **not appearing in the first SVr4 (1989).** **They differ from X/Open's later** *wins\_wstr* **and** *wins\_nwstr* **in that their** *wstr* **parameters are not** *const*-qualified.

## SEE ALSO

**curs\_insstr(3X) describes comparable functions of the** *ncurses* **library in its non-wide-character configuration.**

**curses(3X),** **curs\_ins\_wch(3X),** **curs\_in\_wch(3X)**
